quickvo-sdk-js 1.0.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- (function(Ee,we){typeof exports=="object"&&typeof module<"u"?we(exports):typeof define=="function"&&define.amd?define(["exports"],we):(Ee=typeof globalThis<"u"?globalThis:Ee||self,we(Ee["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var un=Object.defineProperty;var an=Ee=>{throw TypeError(Ee)};var fn=(Ee,we,Me)=>we in Ee?un(Ee,we,{enumerable:!0,configurable:!0,writable:!0,value:Me}):Ee[we]=Me;var ie=(Ee,we,Me)=>fn(Ee,typeof we!="symbol"?we+"":we,Me),cn=(Ee,we,Me)=>we.has(Ee)||an("Cannot "+Me);var ce=(Ee,we,Me)=>(cn(Ee,we,"read from private field"),Me?Me.call(Ee):we.get(Ee)),_e=(Ee,we,Me)=>we.has(Ee)?an("Cannot add the same private member more than once"):we instanceof WeakSet?we.add(Ee):we.set(Ee,Me),Be=(Ee,we,Me,Ze)=>(cn(Ee,we,"write to private field"),Ze?Ze.call(Ee,Me):we.set(Ee,Me),Me);var Ee,we,Me,Ze,Ge,Pt,Lt,Ft,Ct,jt,zt,Ht,We,vt,st,At,Bt,et,it,bt,_t,Dt,wt,Ke,ze,tt,rt,ut,gt,Zt,Jt,St,Vt,Nt,Tt,Gt,Wt,Kt,Ot,qt,Yt,It,Ut,Mt,Xt,kt,Qt,en,tn,nn;const lt=(O,N={})=>{const I={unit:"B",splitStr:" ",...N};let{unit:D,splitStr:f}=I;const k=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=k.findIndex(C=>C===D),c=k.slice(i+1,k.length);let $=O;for(const C of c)if(D=C,$=$/1024,$<1024)break;return`${$.toFixed(2)}${f}${D}`},P$1=(O,N=[])=>{const I={...O},D=Object.keys(I);for(const f of D)N.findIndex(k=>String(k)===f)===-1&&delete I[f];return I},pt=(O,N=[],I=!0)=>{const D=new Map;for(const k of O){const i=[];for(const $ of N)i.push(k[$]);const c=`map-${i.join("-")}`;if(!D.has(c)){D.set(c,k);continue}I&&D.set(c,k)}const f=D.entries();return Array.from(f,([k,i])=>i)},dt=(O,N=[])=>{const I=[];for(const D of O){const f=P$1(D,N);I.push(f)}return I},ht=(O,N="value",I="label")=>{const D=[],f=Object.entries(O);for(const[k,i]of f){const c={[I]:i,[N]:k};D.push(c)}return D},v$1=(O=0,N=1)=>{const I=Math.max(0,O),D=Math.max(1,N),f=Math.random()*(D-I+1)+I;return parseInt(`${f}`,10)},xt=(O=16,N=16)=>{const I="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=Math.min(I.length,N),f=Date.now().toString(D),k=f.split(""),i=Math.max(4,O-f.length);for(let c=0;c<i;c++){const $=v$1(0,D-1),C=I[$];k.push(C)}return k.join("").toUpperCase()},W=(O,N)=>{try{let I=Number(O);if(isNaN(I)){const D=new Date(`${O}`);if(`${D}`=="Invalid Date")return 0;I=D.getTime()}if(N!==void 0){const D=new Date().getTimezoneOffset();I+=(D+N)*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:O,_offset:N,error:I}),0}},H=1e3,R=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=O=>W(O),E=(O,N="YYYY-MM-DD hh:mm:ss",I={})=>{const D={empty_str:"-",...I},{empty_str:f,offset:k}=D,i=W(O,k);if(Number(O)!==0&&i===0)return f;const c=new Date(i),$=`${c.getFullYear()}`,C=`${c.getMonth()+1}`,M=`${c.getDate()}`,J=`${c.getDay()===0?7:c.getDay()}`,Z=`${c.getHours()}`,z=`${c.getMinutes()}`,X=`${c.getSeconds()}`,re=`${Math.ceil((i-L(`${$}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((i-L(`${$}/01/01 00:00:00`))/864e5-Number(J))/7)+1}`,ne=[{k:"Y+",v:$},{k:"M+",v:C},{k:"D+",v:M},{k:"W+",v:J},{k:"h+",v:Z},{k:"m+",v:z},{k:"s+",v:X},{k:"d+",v:re},{k:"w+",v:oe}];let de;for(let{k:ye,v:Q}of ne)if(de=new RegExp(`(${ye})`).exec(N),de){const ae=de[1];let he=Q.padStart(ae.length,"0");ae.includes("W")&&(he=_[he.slice(0,2)]),N=N.replace(ae,he)}return N},V=new Map,$t=(O,N,I)=>{const D=new Date().getTime(),f=V.get(O)||0;D-I>f&&(N(),V.set(O,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:{};function getDefaultExportFromCjs(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var O=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(N){return N.encoding?"rtpmap:%d %s/%s/%s":N.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(N){return N.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(N){return N.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(N){return"extmap:%d"+(N.direction?"/%s":"%v")+(N["encrypt-uri"]?" %s":"%v")+" %s"+(N.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(N){return N.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(N){var I="candidate:%s %d %s %d %s %d typ %s";return I+=N.raddr!=null?" raddr %s rport %d":"%v%v",I+=N.tcptype!=null?" tcptype %s":"%v",N.generation!=null&&(I+=" generation %d"),I+=N["network-id"]!=null?" network-id %d":"%v",I+=N["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(N){var I="ssrc:%d";return N.attribute!=null&&(I+=" %s",N.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(N){return N.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(N){return N.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(N){return"imageattr:%s %s %s"+(N.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(N){return"simulcast:%s %s"+(N.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(N){return"ts-refclk:%s"+(N.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(N){var I="mediaclk:";return I+=N.id!=null?"id=%s %s":"%v%s",I+=N.mediaClockValue!=null?"=%s":"",I+=N.rateNumerator!=null?" rate=%s":"",I+=N.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(O).forEach(function(N){var I=O[N];I.forEach(function(D){D.reg||(D.reg=/(.*)/),D.format||(D.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(O){var N=function(c){return String(Number(c))===c?Number(c):c},I=function(c,$,C,M){if(M&&!C)$[M]=N(c[1]);else for(var J=0;J<C.length;J+=1)c[J+1]!=null&&($[C[J]]=N(c[J+1]))},D=function(c,$,C){var M=c.name&&c.names;c.push&&!$[c.push]?$[c.push]=[]:M&&!$[c.name]&&($[c.name]={});var J=c.push?{}:M?$[c.name]:$;I(C.match(c.reg),J,c.names,c.name),c.push&&$[c.push].push(J)},f=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);O.parse=function(c){var $={},C=[],M=$;return c.split(/(\r\n|\r|\n)/).filter(k).forEach(function(J){var Z=J[0],z=J.slice(2);Z==="m"&&(C.push({rtp:[],fmtp:[]}),M=C[C.length-1]);for(var X=0;X<(f[Z]||[]).length;X+=1){var re=f[Z][X];if(re.reg.test(z))return D(re,M,z)}}),$.media=C,$};var i=function(c,$){var C=$.split(/=(.+)/,2);return C.length===2?c[C[0]]=N(C[1]):C.length===1&&$.length>1&&(c[C[0]]=void 0),c};O.parseParams=function(c){return c.split(/;\s?/).reduce(i,{})},O.parseFmtpConfig=O.parseParams,O.parsePayloads=function(c){return c.toString().split(" ").map(Number)},O.parseRemoteCandidates=function(c){for(var $=[],C=c.split(" ").map(N),M=0;M<C.length;M+=3)$.push({component:C[M],ip:C[M+1],port:C[M+2]});return $},O.parseImageAttributes=function(c){return c.split(" ").map(function($){return $.substring(1,$.length-1).split(",").reduce(i,{})})},O.parseSimulcastStreamList=function(c){return c.split(";").map(function($){return $.split(",").map(function(C){var M,J=!1;return C[0]!=="~"?M=N(C):(M=N(C.substring(1,C.length)),J=!0),{scid:M,paused:J}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var O=requireGrammar(),N=/%[sdv%]/g,I=function(i){var c=1,$=arguments,C=$.length;return i.replace(N,function(M){if(c>=C)return M;var J=$[c];switch(c+=1,M){case"%%":return"%";case"%s":return String(J);case"%d":return Number(J);case"%v":return""}})},D=function(i,c,$){var C=c.format instanceof Function?c.format(c.push?$:$[c.name]):c.format,M=[i+"="+C];if(c.names)for(var J=0;J<c.names.length;J+=1){var Z=c.names[J];c.name?M.push($[c.name][Z]):M.push($[c.names[J]])}else M.push($[c.name]);return I.apply(null,M)},f=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(i,c){c=c||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(J){J.payloads==null&&(J.payloads="")});var $=c.outerOrder||f,C=c.innerOrder||k,M=[];return $.forEach(function(J){O[J].forEach(function(Z){Z.name in i&&i[Z.name]!=null?M.push(D(J,Z,i)):Z.push in i&&i[Z.push]!=null&&i[Z.push].forEach(function(z){M.push(D(J,Z,z))})})}),i.media.forEach(function(J){M.push(D("m",O.m[0],J)),C.forEach(function(Z){O[Z].forEach(function(z){z.name in J&&J[z.name]!=null?M.push(D(Z,z,J)):z.push in J&&J[z.push]!=null&&J[z.push].forEach(function(X){M.push(D(Z,z,X))})})})}),M.join(`\r
1
+ (function(Oe,Te){typeof exports=="object"&&typeof module<"u"?Te(exports):typeof define=="function"&&define.amd?define(["exports"],Te):(Oe=typeof globalThis<"u"?globalThis:Oe||self,Te(Oe["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var on=Object.defineProperty;var en=Oe=>{throw TypeError(Oe)};var an=(Oe,Te,Ce)=>Te in Oe?on(Oe,Te,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):Oe[Te]=Ce;var ne=(Oe,Te,Ce)=>an(Oe,typeof Te!="symbol"?Te+"":Te,Ce),tn=(Oe,Te,Ce)=>Te.has(Oe)||en("Cannot "+Ce);var se=(Oe,Te,Ce)=>(tn(Oe,Te,"read from private field"),Ce?Ce.call(Oe):Te.get(Oe)),ke=(Oe,Te,Ce)=>Te.has(Oe)?en("Cannot add the same private member more than once"):Te instanceof WeakSet?Te.add(Oe):Te.set(Oe,Ce),Be=(Oe,Te,Ce,at)=>(tn(Oe,Te,"write to private field"),at?at.call(Oe,Ce):Te.set(Oe,Ce),Ce);var Oe,Te,Ce,at,Lt,Ft,jt,Ve,vt,st,qt,Nt,Xe,tt,bt,kt,Pt,St,Ge,ze,Qe,nt,ct,Ot,zt,Ht,Tt,Zt,Ut,It,Jt,Vt,Gt,Et,Rt,_t,Wt,ut,Ct,wt,Dt,Mt,gt,Kt,Yt;const lt=(O,N={})=>{const $={unit:"B",splitStr:" ",...N};let{unit:D,splitStr:b}=$;const k=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=k.findIndex(C=>C===D),c=k.slice(i+1,k.length);let S=O;for(const C of c)if(D=C,S=S/1024,S<1024)break;return`${S.toFixed(2)}${b}${D}`},P$1=(O,N=[])=>{const $={...O},D=Object.keys($);for(const b of D)N.findIndex(k=>String(k)===b)===-1&&delete $[b];return $},pt=(O,N=[],$=!0)=>{const D=new Map;for(const k of O){const i=[];for(const S of N)i.push(k[S]);const c=`map-${i.join("-")}`;if(!D.has(c)){D.set(c,k);continue}$&&D.set(c,k)}const b=D.entries();return Array.from(b,([k,i])=>i)},dt=(O,N=[])=>{const $=[];for(const D of O){const b=P$1(D,N);$.push(b)}return $},ht=(O,N="value",$="label")=>{const D=[],b=Object.entries(O);for(const[k,i]of b){const c={[$]:i,[N]:k};D.push(c)}return D},v$1=(O=0,N=1)=>{const $=Math.max(0,O),D=Math.max(1,N),b=Math.random()*(D-$+1)+$;return parseInt(`${b}`,10)},xt=(O=16,N=16)=>{const $="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),D=Math.min($.length,N),b=Date.now().toString(D),k=b.split(""),i=Math.max(4,O-b.length);for(let c=0;c<i;c++){const S=v$1(0,D-1),C=$[S];k.push(C)}return k.join("").toUpperCase()},W=(O,N)=>{try{let $=Number(O);if(isNaN($)){const D=new Date(`${O}`);if(`${D}`=="Invalid Date")return 0;$=D.getTime()}if(N!==void 0){const D=new Date().getTimezoneOffset();$+=(D+N)*60*1e3}return $}catch($){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:O,_offset:N,error:$}),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=O=>W(O),E=(O,N="YYYY-MM-DD hh:mm:ss",$={})=>{const D={empty_str:"-",...$},{empty_str:b,offset:k}=D,i=W(O,k);if(Number(O)!==0&&i===0)return b;const c=new Date(i),S=`${c.getFullYear()}`,C=`${c.getMonth()+1}`,M=`${c.getDate()}`,Z=`${c.getDay()===0?7:c.getDay()}`,J=`${c.getHours()}`,z=`${c.getMinutes()}`,Y=`${c.getSeconds()}`,re=`${Math.ceil((i-L(`${S}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((i-L(`${S}/01/01 00:00:00`))/864e5-Number(Z))/7)+1}`,ie=[{k:"Y+",v:S},{k:"M+",v:C},{k:"D+",v:M},{k:"W+",v:Z},{k:"h+",v:J},{k:"m+",v:z},{k:"s+",v:Y},{k:"d+",v:re},{k:"w+",v:oe}];let de;for(let{k:ye,v:Q}of ie)if(de=new RegExp(`(${ye})`).exec(N),de){const ae=de[1];let he=Q.padStart(ae.length,"0");ae.includes("W")&&(he=_[he.slice(0,2)]),N=N.replace(ae,he)}return N},V=new Map,$t=(O,N,$)=>{const D=new Date().getTime(),b=V.get(O)||0;D-$>b&&(N(),V.set(O,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:{};function getDefaultExportFromCjs(O){return O&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var O=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(N){return N.encoding?"rtpmap:%d %s/%s/%s":N.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(N){return N.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(N){return N.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(N){return"extmap:%d"+(N.direction?"/%s":"%v")+(N["encrypt-uri"]?" %s":"%v")+" %s"+(N.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(N){return N.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(N){var $="candidate:%s %d %s %d %s %d typ %s";return $+=N.raddr!=null?" raddr %s rport %d":"%v%v",$+=N.tcptype!=null?" tcptype %s":"%v",N.generation!=null&&($+=" generation %d"),$+=N["network-id"]!=null?" network-id %d":"%v",$+=N["network-cost"]!=null?" network-cost %d":"%v",$}},{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(N){var $="ssrc:%d";return N.attribute!=null&&($+=" %s",N.value!=null&&($+=":%s")),$}},{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(N){return N.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(N){return N.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(N){return"imageattr:%s %s %s"+(N.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(N){return"simulcast:%s %s"+(N.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(N){return"ts-refclk:%s"+(N.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(N){var $="mediaclk:";return $+=N.id!=null?"id=%s %s":"%v%s",$+=N.mediaClockValue!=null?"=%s":"",$+=N.rateNumerator!=null?" rate=%s":"",$+=N.rateDenominator!=null?"/%s":"",$}},{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(O).forEach(function(N){var $=O[N];$.forEach(function(D){D.reg||(D.reg=/(.*)/),D.format||(D.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(O){var N=function(c){return String(Number(c))===c?Number(c):c},$=function(c,S,C,M){if(M&&!C)S[M]=N(c[1]);else for(var Z=0;Z<C.length;Z+=1)c[Z+1]!=null&&(S[C[Z]]=N(c[Z+1]))},D=function(c,S,C){var M=c.name&&c.names;c.push&&!S[c.push]?S[c.push]=[]:M&&!S[c.name]&&(S[c.name]={});var Z=c.push?{}:M?S[c.name]:S;$(C.match(c.reg),Z,c.names,c.name),c.push&&S[c.push].push(Z)},b=requireGrammar(),k=RegExp.prototype.test.bind(/^([a-z])=(.*)/);O.parse=function(c){var S={},C=[],M=S;return c.split(/(\r\n|\r|\n)/).filter(k).forEach(function(Z){var J=Z[0],z=Z.slice(2);J==="m"&&(C.push({rtp:[],fmtp:[]}),M=C[C.length-1]);for(var Y=0;Y<(b[J]||[]).length;Y+=1){var re=b[J][Y];if(re.reg.test(z))return D(re,M,z)}}),S.media=C,S};var i=function(c,S){var C=S.split(/=(.+)/,2);return C.length===2?c[C[0]]=N(C[1]):C.length===1&&S.length>1&&(c[C[0]]=void 0),c};O.parseParams=function(c){return c.split(/;\s?/).reduce(i,{})},O.parseFmtpConfig=O.parseParams,O.parsePayloads=function(c){return c.toString().split(" ").map(Number)},O.parseRemoteCandidates=function(c){for(var S=[],C=c.split(" ").map(N),M=0;M<C.length;M+=3)S.push({component:C[M],ip:C[M+1],port:C[M+2]});return S},O.parseImageAttributes=function(c){return c.split(" ").map(function(S){return S.substring(1,S.length-1).split(",").reduce(i,{})})},O.parseSimulcastStreamList=function(c){return c.split(";").map(function(S){return S.split(",").map(function(C){var M,Z=!1;return C[0]!=="~"?M=N(C):(M=N(C.substring(1,C.length)),Z=!0),{scid:M,paused:Z}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var O=requireGrammar(),N=/%[sdv%]/g,$=function(i){var c=1,S=arguments,C=S.length;return i.replace(N,function(M){if(c>=C)return M;var Z=S[c];switch(c+=1,M){case"%%":return"%";case"%s":return String(Z);case"%d":return Number(Z);case"%v":return""}})},D=function(i,c,S){var C=c.format instanceof Function?c.format(c.push?S:S[c.name]):c.format,M=[i+"="+C];if(c.names)for(var Z=0;Z<c.names.length;Z+=1){var J=c.names[Z];c.name?M.push(S[c.name][J]):M.push(S[c.names[Z]])}else M.push(S[c.name]);return $.apply(null,M)},b=["v","o","s","i","u","e","p","c","b","t","r","z","a"],k=["i","c","b","a"];return writer$1=function(i,c){c=c||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(Z){Z.payloads==null&&(Z.payloads="")});var S=c.outerOrder||b,C=c.innerOrder||k,M=[];return S.forEach(function(Z){O[Z].forEach(function(J){J.name in i&&i[J.name]!=null?M.push(D(Z,J,i)):J.push in i&&i[J.push]!=null&&i[J.push].forEach(function(z){M.push(D(Z,J,z))})})}),i.media.forEach(function(Z){M.push(D("m",O.m[0],Z)),C.forEach(function(J){O[J].forEach(function(z){z.name in Z&&Z[z.name]!=null?M.push(D(J,z,Z)):z.push in Z&&Z[z.push]!=null&&Z[z.push].forEach(function(Y){M.push(D(J,z,Y))})})})}),M.join(`\r
2
2
  `)+`\r
3
- `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var O=requireParser(),N=requireWriter$1(),I=requireGrammar();return lib$1.grammar=I,lib$1.write=N,lib$1.parse=O.parse,lib$1.parseParams=O.parseParams,lib$1.parseFmtpConfig=O.parseFmtpConfig,lib$1.parsePayloads=O.parsePayloads,lib$1.parseRemoteCandidates=O.parseRemoteCandidates,lib$1.parseImageAttributes=O.parseImageAttributes,lib$1.parseSimulcastStreamList=O.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(N){ie(this,"kind","video");ie(this,"stream",new MediaStream);ie(this,"stop",()=>{const N=this.stream.getTracks();for(const I of N)I.stop(),this.stream.removeTrack(I)});ie(this,"replaceStream",N=>{const I=this.stream,D=I.getTracks();for(const k of D)I.removeTrack(k);const[f]=N.getVideoTracks();f&&I.addTrack(f)});ie(this,"getStream",()=>this.stream);ie(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(N)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var y$1=Object.defineProperty,B=O=>{throw TypeError(O)},v=(O,N,I)=>N in O?y$1(O,N,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[N]=I,l$1=(O,N,I)=>v(O,typeof N!="symbol"?N+"":N,I),T=(O,N,I)=>N.has(O)||B("Cannot "+I),t=(O,N,I)=>(T(O,N,"read from private field"),I?I.call(O):N.get(O)),o=(O,N,I)=>N.has(O)?B("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(O):N.set(O,I),r=(O,N,I,D)=>(T(O,N,"write to private field"),N.set(O,I),I),s$1,a$1,h,u$1,m$1,p$1,d$1,x$1,g$1,b,w;class S{constructor(N){o(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!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$1(this,"ws"),o(this,a$1,-1),o(this,h,-1),o(this,u$1,0),o(this,m$1,0),o(this,p$1,0),o(this,d$1,!1),l$1(this,"connect",()=>new Promise(async(I,D)=>{this.ws=new WebSocket(t(this,s$1).url),this.ws.binaryType=t(this,s$1).binaryType,this.ws.addEventListener("message",t(this,g$1)),this.ws.addEventListener("open",f=>{clearTimeout(t(this,u$1)),r(this,a$1,t(this,s$1).reconnectCount),r(this,h,-1),t(this,b).call(this),t(this,s$1).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(f)}),this.ws.addEventListener("error",f=>{clearTimeout(t(this,u$1)),t(this,s$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",f),D(f)}),this.ws.addEventListener("close",f=>{if(t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${f.code}, permanentClosed is ${t(this,d$1)}.`,f),t(this,w).call(this),!t(this,d$1))return this.reconnect(f);this.ws=void 0}),r(this,u$1,window.setTimeout(()=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",this),D("connect is timeout.")},t(this,s$1).timeout))})),l$1(this,"reconnect",async I=>new Promise(D=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const f=k=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),t(this,s$1).onReconnectStop({msg:k}),D(k)};if(t(this,x$1).call(this)===!1)return f("stop reconnect. exceed maxReconnectionTime.");if(t(this,a$1)!==-1&&t(this,a$1)===0)return f("stop reconnect. surplusReconnectCount is 0.");if(!t(this,s$1).checkReconnect(I))return f("stop reconnect. checkReconnect is false.");t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,a$1)}`,I),r(this,m$1,window.setTimeout(async()=>{r(this,a$1,Math.max(-1,t(this,a$1)-1)),await this.connect();try{await t(this,s$1).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$1).reconnectIntervalTime))})),l$1(this,"sendMessage",async I=>{var D;(!this.ws||this.ws.readyState!==1)&&(t(this,s$1).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$1).autoConnect&&(t(this,s$1).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(I)}),l$1(this,"close",async(I=1e3,D="correctly close.")=>{var f;this.ws&&(r(this,d$1,!0),t(this,w).call(this),(f=this.ws)==null||f.close(I,D))}),o(this,x$1,()=>{const I=Date.now();return t(this,h)===-1&&r(this,h,I+t(this,s$1).reconnectTime),!(I>t(this,h))}),o(this,g$1,I=>{const{data:D}=I;t(this,s$1).onMessage(D)}),o(this,b,()=>{r(this,p$1,window.setInterval(()=>{const I=t(this,s$1).getHeartbeatMsg();I&&this.sendMessage(I)},t(this,s$1).heartbeatIntervalTime))}),o(this,w,()=>{clearInterval(t(this,m$1)),clearInterval(t(this,p$1))}),r(this,s$1,{...t(this,s$1),...N}),r(this,a$1,t(this,s$1).reconnectCount)}}s$1=new WeakMap,a$1=new WeakMap,h=new WeakMap,u$1=new WeakMap,m$1=new WeakMap,p$1=new WeakMap,d$1=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b=new WeakMap,w=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=O;function O(N,I){for(var D=new Array(arguments.length-1),f=0,k=2,i=!0;k<arguments.length;)D[f++]=arguments[k++];return new Promise(function($,C){D[f]=function(J){if(i)if(i=!1,J)C(J);else{for(var Z=new Array(arguments.length-1),z=0;z<Z.length;)Z[z++]=arguments[z];$.apply(null,Z)}};try{N.apply(I||null,D)}catch(M){i&&(i=!1,C(M))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(O){var N=O;N.length=function(c){var $=c.length;if(!$)return 0;for(var C=0;--$%4>1&&c.charAt($)==="=";)++C;return Math.ceil(c.length*3)/4-C};for(var I=new Array(64),D=new Array(123),f=0;f<64;)D[I[f]=f<26?f+65:f<52?f+71:f<62?f-4:f-59|43]=f++;N.encode=function(c,$,C){for(var M=null,J=[],Z=0,z=0,X;$<C;){var re=c[$++];switch(z){case 0:J[Z++]=I[re>>2],X=(re&3)<<4,z=1;break;case 1:J[Z++]=I[X|re>>4],X=(re&15)<<2,z=2;break;case 2:J[Z++]=I[X|re>>6],J[Z++]=I[re&63],z=0;break}Z>8191&&((M||(M=[])).push(String.fromCharCode.apply(String,J)),Z=0)}return z&&(J[Z++]=I[X],J[Z++]=61,z===1&&(J[Z++]=61)),M?(Z&&M.push(String.fromCharCode.apply(String,J.slice(0,Z))),M.join("")):String.fromCharCode.apply(String,J.slice(0,Z))};var k="invalid encoding";N.decode=function(c,$,C){for(var M=C,J=0,Z,z=0;z<c.length;){var X=c.charCodeAt(z++);if(X===61&&J>1)break;if((X=D[X])===void 0)throw Error(k);switch(J){case 0:Z=X,J=1;break;case 1:$[C++]=Z<<2|(X&48)>>4,Z=X,J=2;break;case 2:$[C++]=(Z&15)<<4|(X&60)>>2,Z=X,J=3;break;case 3:$[C++]=(Z&3)<<6|X,J=0;break}}if(J===1)throw Error(k);return C-M},N.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=O;function O(){this._listeners={}}return O.prototype.on=function(I,D,f){return(this._listeners[I]||(this._listeners[I]=[])).push({fn:D,ctx:f||this}),this},O.prototype.off=function(I,D){if(I===void 0)this._listeners={};else if(D===void 0)this._listeners[I]=[];else for(var f=this._listeners[I],k=0;k<f.length;)f[k].fn===D?f.splice(k,1):++k;return this},O.prototype.emit=function(I){var D=this._listeners[I];if(D){for(var f=[],k=1;k<arguments.length;)f.push(arguments[k++]);for(k=0;k<D.length;)D[k].fn.apply(D[k++].ctx,f)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=O(O);function O(k){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),c=new Uint8Array(i.buffer),$=c[3]===128;function C(z,X,re){i[0]=z,X[re]=c[0],X[re+1]=c[1],X[re+2]=c[2],X[re+3]=c[3]}function M(z,X,re){i[0]=z,X[re]=c[3],X[re+1]=c[2],X[re+2]=c[1],X[re+3]=c[0]}k.writeFloatLE=$?C:M,k.writeFloatBE=$?M:C;function J(z,X){return c[0]=z[X],c[1]=z[X+1],c[2]=z[X+2],c[3]=z[X+3],i[0]}function Z(z,X){return c[3]=z[X],c[2]=z[X+1],c[1]=z[X+2],c[0]=z[X+3],i[0]}k.readFloatLE=$?J:Z,k.readFloatBE=$?Z:J}():function(){function i($,C,M,J){var Z=C<0?1:0;if(Z&&(C=-C),C===0)$(1/C>0?0:2147483648,M,J);else if(isNaN(C))$(2143289344,M,J);else if(C>34028234663852886e22)$((Z<<31|2139095040)>>>0,M,J);else if(C<11754943508222875e-54)$((Z<<31|Math.round(C/1401298464324817e-60))>>>0,M,J);else{var z=Math.floor(Math.log(C)/Math.LN2),X=Math.round(C*Math.pow(2,-z)*8388608)&8388607;$((Z<<31|z+127<<23|X)>>>0,M,J)}}k.writeFloatLE=i.bind(null,N),k.writeFloatBE=i.bind(null,I);function c($,C,M){var J=$(C,M),Z=(J>>31)*2+1,z=J>>>23&255,X=J&8388607;return z===255?X?NaN:Z*(1/0):z===0?Z*1401298464324817e-60*X:Z*Math.pow(2,z-150)*(X+8388608)}k.readFloatLE=c.bind(null,D),k.readFloatBE=c.bind(null,f)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),c=new Uint8Array(i.buffer),$=c[7]===128;function C(z,X,re){i[0]=z,X[re]=c[0],X[re+1]=c[1],X[re+2]=c[2],X[re+3]=c[3],X[re+4]=c[4],X[re+5]=c[5],X[re+6]=c[6],X[re+7]=c[7]}function M(z,X,re){i[0]=z,X[re]=c[7],X[re+1]=c[6],X[re+2]=c[5],X[re+3]=c[4],X[re+4]=c[3],X[re+5]=c[2],X[re+6]=c[1],X[re+7]=c[0]}k.writeDoubleLE=$?C:M,k.writeDoubleBE=$?M:C;function J(z,X){return c[0]=z[X],c[1]=z[X+1],c[2]=z[X+2],c[3]=z[X+3],c[4]=z[X+4],c[5]=z[X+5],c[6]=z[X+6],c[7]=z[X+7],i[0]}function Z(z,X){return c[7]=z[X],c[6]=z[X+1],c[5]=z[X+2],c[4]=z[X+3],c[3]=z[X+4],c[2]=z[X+5],c[1]=z[X+6],c[0]=z[X+7],i[0]}k.readDoubleLE=$?J:Z,k.readDoubleBE=$?Z:J}():function(){function i($,C,M,J,Z,z){var X=J<0?1:0;if(X&&(J=-J),J===0)$(0,Z,z+C),$(1/J>0?0:2147483648,Z,z+M);else if(isNaN(J))$(0,Z,z+C),$(2146959360,Z,z+M);else if(J>17976931348623157e292)$(0,Z,z+C),$((X<<31|2146435072)>>>0,Z,z+M);else{var re;if(J<22250738585072014e-324)re=J/5e-324,$(re>>>0,Z,z+C),$((X<<31|re/4294967296)>>>0,Z,z+M);else{var oe=Math.floor(Math.log(J)/Math.LN2);oe===1024&&(oe=1023),re=J*Math.pow(2,-oe),$(re*4503599627370496>>>0,Z,z+C),$((X<<31|oe+1023<<20|re*1048576&1048575)>>>0,Z,z+M)}}}k.writeDoubleLE=i.bind(null,N,0,4),k.writeDoubleBE=i.bind(null,I,4,0);function c($,C,M,J,Z){var z=$(J,Z+C),X=$(J,Z+M),re=(X>>31)*2+1,oe=X>>>20&2047,ne=4294967296*(X&1048575)+z;return oe===2047?ne?NaN:re*(1/0):oe===0?re*5e-324*ne:re*Math.pow(2,oe-1075)*(ne+4503599627370496)}k.readDoubleLE=c.bind(null,D,0,4),k.readDoubleBE=c.bind(null,f,4,0)}(),k}function N(k,i,c){i[c]=k&255,i[c+1]=k>>>8&255,i[c+2]=k>>>16&255,i[c+3]=k>>>24}function I(k,i,c){i[c]=k>>>24,i[c+1]=k>>>16&255,i[c+2]=k>>>8&255,i[c+3]=k&255}function D(k,i){return(k[i]|k[i+1]<<8|k[i+2]<<16|k[i+3]<<24)>>>0}function f(k,i){return(k[i]<<24|k[i+1]<<16|k[i+2]<<8|k[i+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(O){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(O){var N=O;N.length=function(D){for(var f=0,k=0,i=0;i<D.length;++i)k=D.charCodeAt(i),k<128?f+=1:k<2048?f+=2:(k&64512)===55296&&(D.charCodeAt(i+1)&64512)===56320?(++i,f+=4):f+=3;return f},N.read=function(D,f,k){var i=k-f;if(i<1)return"";for(var c=null,$=[],C=0,M;f<k;)M=D[f++],M<128?$[C++]=M:M>191&&M<224?$[C++]=(M&31)<<6|D[f++]&63:M>239&&M<365?(M=((M&7)<<18|(D[f++]&63)<<12|(D[f++]&63)<<6|D[f++]&63)-65536,$[C++]=55296+(M>>10),$[C++]=56320+(M&1023)):$[C++]=(M&15)<<12|(D[f++]&63)<<6|D[f++]&63,C>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,$)),C=0);return c?(C&&c.push(String.fromCharCode.apply(String,$.slice(0,C))),c.join("")):String.fromCharCode.apply(String,$.slice(0,C))},N.write=function(D,f,k){for(var i=k,c,$,C=0;C<D.length;++C)c=D.charCodeAt(C),c<128?f[k++]=c:c<2048?(f[k++]=c>>6|192,f[k++]=c&63|128):(c&64512)===55296&&(($=D.charCodeAt(C+1))&64512)===56320?(c=65536+((c&1023)<<10)+($&1023),++C,f[k++]=c>>18|240,f[k++]=c>>12&63|128,f[k++]=c>>6&63|128,f[k++]=c&63|128):(f[k++]=c>>12|224,f[k++]=c>>6&63|128,f[k++]=c&63|128);return k-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=O;function O(N,I,D){var f=D||8192,k=f>>>1,i=null,c=f;return function(C){if(C<1||C>k)return N(C);c+C>f&&(i=N(f),c=0);var M=I.call(i,c,c+=C);return c&7&&(c=(c|7)+1),M}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=N;var O=requireMinimal$1();function N(k,i){this.lo=k>>>0,this.hi=i>>>0}var I=N.zero=new N(0,0);I.toNumber=function(){return 0},I.zzEncode=I.zzDecode=function(){return this},I.length=function(){return 1};var D=N.zeroHash="\0\0\0\0\0\0\0\0";N.fromNumber=function(i){if(i===0)return I;var c=i<0;c&&(i=-i);var $=i>>>0,C=(i-$)/4294967296>>>0;return c&&(C=~C>>>0,$=~$>>>0,++$>4294967295&&($=0,++C>4294967295&&(C=0))),new N($,C)},N.from=function(i){if(typeof i=="number")return N.fromNumber(i);if(O.isString(i))if(O.Long)i=O.Long.fromString(i);else return N.fromNumber(parseInt(i,10));return i.low||i.high?new N(i.low>>>0,i.high>>>0):I},N.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var c=~this.lo+1>>>0,$=~this.hi>>>0;return c||($=$+1>>>0),-(c+$*4294967296)}return this.lo+this.hi*4294967296},N.prototype.toLong=function(i){return O.Long?new O.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var f=String.prototype.charCodeAt;return N.fromHash=function(i){return i===D?I:new N((f.call(i,0)|f.call(i,1)<<8|f.call(i,2)<<16|f.call(i,3)<<24)>>>0,(f.call(i,4)|f.call(i,5)<<8|f.call(i,6)<<16|f.call(i,7)<<24)>>>0)},N.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)},N.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},N.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},N.prototype.length=function(){var i=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,$=this.hi>>>24;return $===0?c===0?i<16384?i<128?1:2:i<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:$<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(O){var N=O;N.asPromise=requireAspromise(),N.base64=requireBase64(),N.EventEmitter=requireEventemitter(),N.float=requireFloat(),N.inquire=requireInquire(),N.utf8=requireUtf8(),N.pool=requirePool(),N.LongBits=requireLongbits(),N.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),N.global=N.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,N.emptyArray=Object.freeze?Object.freeze([]):[],N.emptyObject=Object.freeze?Object.freeze({}):{},N.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},N.isString=function(k){return typeof k=="string"||k instanceof String},N.isObject=function(k){return k&&typeof k=="object"},N.isset=N.isSet=function(k,i){var c=k[i];return c!=null&&k.hasOwnProperty(i)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},N.Buffer=function(){try{var f=N.inquire("buffer").Buffer;return f.prototype.utf8Write?f:null}catch{return null}}(),N._Buffer_from=null,N._Buffer_allocUnsafe=null,N.newBuffer=function(k){return typeof k=="number"?N.Buffer?N._Buffer_allocUnsafe(k):new N.Array(k):N.Buffer?N._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},N.Array=typeof Uint8Array<"u"?Uint8Array:Array,N.Long=N.global.dcodeIO&&N.global.dcodeIO.Long||N.global.Long||N.inquire("long"),N.key2Re=/^true|false|0|1$/,N.key32Re=/^-?(?:0|[1-9][0-9]*)$/,N.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,N.longToHash=function(k){return k?N.LongBits.from(k).toHash():N.LongBits.zeroHash},N.longFromHash=function(k,i){var c=N.LongBits.fromHash(k);return N.Long?N.Long.fromBits(c.lo,c.hi,i):c.toNumber(!!i)};function I(f,k,i){for(var c=Object.keys(k),$=0;$<c.length;++$)(f[c[$]]===void 0||!i)&&(f[c[$]]=k[c[$]]);return f}N.merge=I,N.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function D(f){function k(i,c){if(!(this instanceof k))return new k(i,c);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&I(this,c)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return f},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),k}N.newError=D,N.ProtocolError=D("ProtocolError"),N.oneOfGetter=function(k){for(var i={},c=0;c<k.length;++c)i[k[c]]=1;return function(){for(var $=Object.keys(this),C=$.length-1;C>-1;--C)if(i[$[C]]===1&&this[$[C]]!==void 0&&this[$[C]]!==null)return $[C]}},N.oneOfSetter=function(k){return function(i){for(var c=0;c<k.length;++c)k[c]!==i&&delete this[k[c]]}},N.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},N._configure=function(){var f=N.Buffer;if(!f){N._Buffer_from=N._Buffer_allocUnsafe=null;return}N._Buffer_from=f.from!==Uint8Array.from&&f.from||function(i,c){return new f(i,c)},N._Buffer_allocUnsafe=f.allocUnsafe||function(i){return new f(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=$;var O=requireMinimal$1(),N,I=O.LongBits,D=O.base64,f=O.utf8;function k(oe,ne,de){this.fn=oe,this.len=ne,this.next=void 0,this.val=de}function i(){}function c(oe){this.head=oe.head,this.tail=oe.tail,this.len=oe.len,this.next=oe.states}function $(){this.len=0,this.head=new k(i,0,0),this.tail=this.head,this.states=null}var C=function(){return O.Buffer?function(){return($.create=function(){return new N})()}:function(){return new $}};$.create=C(),$.alloc=function(ne){return new O.Array(ne)},O.Array!==Array&&($.alloc=O.pool($.alloc,O.Array.prototype.subarray)),$.prototype._push=function(ne,de,ye){return this.tail=this.tail.next=new k(ne,de,ye),this.len+=de,this};function M(oe,ne,de){ne[de]=oe&255}function J(oe,ne,de){for(;oe>127;)ne[de++]=oe&127|128,oe>>>=7;ne[de]=oe}function Z(oe,ne){this.len=oe,this.next=void 0,this.val=ne}Z.prototype=Object.create(k.prototype),Z.prototype.fn=J,$.prototype.uint32=function(ne){return this.len+=(this.tail=this.tail.next=new Z((ne=ne>>>0)<128?1:ne<16384?2:ne<2097152?3:ne<268435456?4:5,ne)).len,this},$.prototype.int32=function(ne){return ne<0?this._push(z,10,I.fromNumber(ne)):this.uint32(ne)},$.prototype.sint32=function(ne){return this.uint32((ne<<1^ne>>31)>>>0)};function z(oe,ne,de){for(;oe.hi;)ne[de++]=oe.lo&127|128,oe.lo=(oe.lo>>>7|oe.hi<<25)>>>0,oe.hi>>>=7;for(;oe.lo>127;)ne[de++]=oe.lo&127|128,oe.lo=oe.lo>>>7;ne[de++]=oe.lo}$.prototype.uint64=function(ne){var de=I.from(ne);return this._push(z,de.length(),de)},$.prototype.int64=$.prototype.uint64,$.prototype.sint64=function(ne){var de=I.from(ne).zzEncode();return this._push(z,de.length(),de)},$.prototype.bool=function(ne){return this._push(M,1,ne?1:0)};function X(oe,ne,de){ne[de]=oe&255,ne[de+1]=oe>>>8&255,ne[de+2]=oe>>>16&255,ne[de+3]=oe>>>24}$.prototype.fixed32=function(ne){return this._push(X,4,ne>>>0)},$.prototype.sfixed32=$.prototype.fixed32,$.prototype.fixed64=function(ne){var de=I.from(ne);return this._push(X,4,de.lo)._push(X,4,de.hi)},$.prototype.sfixed64=$.prototype.fixed64,$.prototype.float=function(ne){return this._push(O.float.writeFloatLE,4,ne)},$.prototype.double=function(ne){return this._push(O.float.writeDoubleLE,8,ne)};var re=O.Array.prototype.set?function(ne,de,ye){de.set(ne,ye)}:function(ne,de,ye){for(var Q=0;Q<ne.length;++Q)de[ye+Q]=ne[Q]};return $.prototype.bytes=function(ne){var de=ne.length>>>0;if(!de)return this._push(M,1,0);if(O.isString(ne)){var ye=$.alloc(de=D.length(ne));D.decode(ne,ye,0),ne=ye}return this.uint32(de)._push(re,de,ne)},$.prototype.string=function(ne){var de=f.length(ne);return de?this.uint32(de)._push(f.write,de,ne):this._push(M,1,0)},$.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new k(i,0,0),this.len=0,this},$.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(i,0,0),this.len=0),this},$.prototype.ldelim=function(){var ne=this.head,de=this.tail,ye=this.len;return this.reset().uint32(ye),ye&&(this.tail.next=ne.next,this.tail=de,this.len+=ye),this},$.prototype.finish=function(){for(var ne=this.head.next,de=this.constructor.alloc(this.len),ye=0;ne;)ne.fn(ne.val,de,ye),ye+=ne.len,ne=ne.next;return de},$._configure=function(oe){N=oe,$.create=C(),N._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=I;var O=requireWriter();(I.prototype=Object.create(O.prototype)).constructor=I;var N=requireMinimal$1();function I(){O.call(this)}I._configure=function(){I.alloc=N._Buffer_allocUnsafe,I.writeBytesBuffer=N.Buffer&&N.Buffer.prototype instanceof Uint8Array&&N.Buffer.prototype.set.name==="set"?function(k,i,c){i.set(k,c)}:function(k,i,c){if(k.copy)k.copy(i,c,0,k.length);else for(var $=0;$<k.length;)i[c++]=k[$++]}},I.prototype.bytes=function(k){N.isString(k)&&(k=N._Buffer_from(k,"base64"));var i=k.length>>>0;return this.uint32(i),i&&this._push(I.writeBytesBuffer,i,k),this};function D(f,k,i){f.length<40?N.utf8.write(f,k,i):k.utf8Write?k.utf8Write(f,i):k.write(f,i)}return I.prototype.string=function(k){var i=N.Buffer.byteLength(k);return this.uint32(i),i&&this._push(D,i,k),this},I._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var O=requireMinimal$1(),N,I=O.LongBits,D=O.utf8;function f(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 i=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")},c=function(){return O.Buffer?function(z){return(k.create=function(re){return O.Buffer.isBuffer(re)?new N(re):i(re)})(z)}:i};k.create=c(),k.prototype._slice=O.Array.prototype.subarray||O.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,f(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 $(){var J=new I(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 f(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 f(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 C(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 f(this,4);return C(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw f(this,4);return C(this.buf,this.pos+=4)|0};function M(){if(this.pos+8>this.len)throw f(this,8);return new I(C(this.buf,this.pos+=4),C(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw f(this,4);var Z=O.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z},k.prototype.double=function(){if(this.pos+8>this.len)throw f(this,4);var Z=O.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z},k.prototype.bytes=function(){var Z=this.uint32(),z=this.pos,X=this.pos+Z;if(X>this.len)throw f(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(z,X);if(z===X){var re=O.Buffer;return re?re.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,z,X)},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 f(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw f(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){N=J,k.create=c(),N._configure();var Z=O.Long?"toLong":"toNumber";O.merge(k.prototype,{int64:function(){return $.call(this)[Z](!1)},uint64:function(){return $.call(this)[Z](!0)},sint64:function(){return $.call(this).zzDecode()[Z](!1)},fixed64:function(){return M.call(this)[Z](!0)},sfixed64:function(){return M.call(this)[Z](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=I;var O=requireReader();(I.prototype=Object.create(O.prototype)).constructor=I;var N=requireMinimal$1();function I(D){O.call(this,D)}return I._configure=function(){N.Buffer&&(I.prototype._slice=N.Buffer.prototype.slice)},I.prototype.string=function(){var f=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+f,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+f,this.len))},I._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=N;var O=requireMinimal$1();(N.prototype=Object.create(O.EventEmitter.prototype)).constructor=N;function N(I,D,f){if(typeof I!="function")throw TypeError("rpcImpl must be a function");O.EventEmitter.call(this),this.rpcImpl=I,this.requestDelimited=!!D,this.responseDelimited=!!f}return N.prototype.rpcCall=function I(D,f,k,i,c){if(!i)throw TypeError("request must be specified");var $=this;if(!c)return O.asPromise(I,$,D,f,k,i);if(!$.rpcImpl){setTimeout(function(){c(Error("already ended"))},0);return}try{return $.rpcImpl(D,f[$.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(M,J){if(M)return $.emit("error",M,D),c(M);if(J===null){$.end(!0);return}if(!(J instanceof k))try{J=k[$.responseDelimited?"decodeDelimited":"decode"](J)}catch(Z){return $.emit("error",Z,D),c(Z)}return $.emit("data",J,D),c(null,J)})}catch(C){$.emit("error",C,D),setTimeout(function(){c(C)},0);return}},N.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(O){var N=O;N.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(O){var N=O;N.build="minimal",N.Writer=requireWriter(),N.BufferWriter=requireWriter_buffer(),N.Reader=requireReader(),N.BufferReader=requireReader_buffer(),N.util=requireMinimal$1(),N.rpc=requireRpc(),N.roots=requireRoots(),N.configure=I;function I(){N.util._configure(),N.Writer._configure(N.BufferWriter),N.Reader._configure(N.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 O={};return O.quick=function(){const N={};return N.voice=function(){const I={};return I.proto=function(){const D={};return D.CommonReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.event="",f.prototype.data=$util.newBuffer([]),f.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.version=0,f.prototype.compress=!1,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(56).bool(i.compress),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.version=i.int32();break}case 7:{C.compress=i.bool();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let c=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},f.toObject=function(i,c){c||(c={});let $={};if(c.defaults){if($.event="",c.bytes===String?$.data="":($.data=[],c.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let C=new $util.Long(0,0,!1);$.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);$.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);$.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.valid=c.longs===String?"0":0;$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=c.longs===String?String(i.sn):i.sn:$.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=c.longs===String?String(i.time):i.time:$.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?$.valid=c.longs===String?String(i.valid):i.valid:$.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},f}(),D.CommonRsp=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.event="",f.prototype.data=$util.newBuffer([]),f.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.code=0,f.prototype.desc="",f.prototype.version=0,f.prototype.compress=!1,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&c.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&c.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(72).bool(i.compress),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.code=i.int32();break}case 7:{C.desc=i.string();break}case 8:{C.version=i.int32();break}case 9:{C.compress=i.bool();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let c=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(c.code=i.code|0),i.desc!=null&&(c.desc=String(i.desc)),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},f.toObject=function(i,c){c||(c={});let $={};if(c.defaults){if($.event="",c.bytes===String?$.data="":($.data=[],c.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let C=new $util.Long(0,0,!1);$.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);$.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);$.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.valid=c.longs===String?"0":0;$.code=0,$.desc="",$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=c.longs===String?String(i.sn):i.sn:$.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=c.longs===String?String(i.time):i.time:$.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?$.valid=c.longs===String?String(i.valid):i.valid:$.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&($.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&($.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},f}(),D.User=function(){function f(i){if(this.tracks=[],i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.id="",f.prototype.callAction=null,f.prototype.callState=null,f.prototype.joinTime=null,f.prototype.tracks=$util.emptyArray,f.prototype.permissions=null,f.prototype.isPublished=null,f.prototype.behavior=null,f.prototype.channelCache=null;let k;return Object.defineProperty(f.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_channelCache",{get:$util.oneOfGetter(k=["channelCache"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){if($||($=$Writer.create()),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&$.uint32(10).string(c.id),c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&$.uint32(16).int32(c.callAction),c.callState!=null&&Object.hasOwnProperty.call(c,"callState")&&$.uint32(24).int32(c.callState),c.joinTime!=null&&Object.hasOwnProperty.call(c,"joinTime")&&$.uint32(32).int64(c.joinTime),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],$.uint32(42).fork()).ldelim();return c.permissions!=null&&Object.hasOwnProperty.call(c,"permissions")&&$.uint32(48).int32(c.permissions),c.isPublished!=null&&Object.hasOwnProperty.call(c,"isPublished")&&$.uint32(56).bool(c.isPublished),c.behavior!=null&&Object.hasOwnProperty.call(c,"behavior")&&$.uint32(64).int32(c.behavior),c.channelCache!=null&&Object.hasOwnProperty.call(c,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(c.channelCache,$.uint32(74).fork()).ldelim(),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.User;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.id=c.string();break}case 2:{M.callAction=c.int32();break}case 3:{M.callState=c.int32();break}case 4:{M.joinTime=c.int64();break}case 5:{M.tracks&&M.tracks.length||(M.tracks=[]),M.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 6:{M.permissions=c.int32();break}case 7:{M.isPublished=c.bool();break}case 8:{M.behavior=c.int32();break}case 9:{M.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(c,c.uint32());break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.id!=null&&c.hasOwnProperty("id")&&!$util.isString(c.id))return"id: string expected";if(c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction))return"callAction: integer expected";if(c.callState!=null&&c.hasOwnProperty("callState")&&!$util.isInteger(c.callState))return"callState: integer expected";if(c.joinTime!=null&&c.hasOwnProperty("joinTime")&&!$util.isInteger(c.joinTime)&&!(c.joinTime&&$util.isInteger(c.joinTime.low)&&$util.isInteger(c.joinTime.high)))return"joinTime: integer|Long expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let $=0;$<c.tracks.length;++$){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[$]);if(C)return"tracks."+C}}if(c.permissions!=null&&c.hasOwnProperty("permissions")&&!$util.isInteger(c.permissions))return"permissions: integer expected";if(c.isPublished!=null&&c.hasOwnProperty("isPublished")&&typeof c.isPublished!="boolean")return"isPublished: boolean expected";if(c.behavior!=null&&c.hasOwnProperty("behavior")&&!$util.isInteger(c.behavior))return"behavior: integer expected";if(c.channelCache!=null&&c.hasOwnProperty("channelCache")){let $=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(c.channelCache);if($)return"channelCache."+$}return null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.User)return c;let $=new $root.com.quick.voice.proto.User;if(c.id!=null&&($.id=String(c.id)),c.callAction!=null&&($.callAction=c.callAction|0),c.callState!=null&&($.callState=c.callState|0),c.joinTime!=null&&($util.Long?($.joinTime=$util.Long.fromValue(c.joinTime)).unsigned=!1:typeof c.joinTime=="string"?$.joinTime=parseInt(c.joinTime,10):typeof c.joinTime=="number"?$.joinTime=c.joinTime:typeof c.joinTime=="object"&&($.joinTime=new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber())),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");$.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");$.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}if(c.permissions!=null&&($.permissions=c.permissions|0),c.isPublished!=null&&($.isPublished=!!c.isPublished),c.behavior!=null&&($.behavior=c.behavior|0),c.channelCache!=null){if(typeof c.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");$.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(c.channelCache)}return $},f.toObject=function(c,$){$||($={});let C={};if(($.arrays||$.defaults)&&(C.tracks=[]),$.defaults&&(C.id=""),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id),c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction,$.oneofs&&(C._callAction="callAction")),c.callState!=null&&c.hasOwnProperty("callState")&&(C.callState=c.callState,$.oneofs&&(C._callState="callState")),c.joinTime!=null&&c.hasOwnProperty("joinTime")&&(typeof c.joinTime=="number"?C.joinTime=$.longs===String?String(c.joinTime):c.joinTime:C.joinTime=$.longs===String?$util.Long.prototype.toString.call(c.joinTime):$.longs===Number?new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber():c.joinTime,$.oneofs&&(C._joinTime="joinTime")),c.tracks&&c.tracks.length){C.tracks=[];for(let M=0;M<c.tracks.length;++M)C.tracks[M]=$root.com.quick.voice.proto.Track.toObject(c.tracks[M],$)}return c.permissions!=null&&c.hasOwnProperty("permissions")&&(C.permissions=c.permissions,$.oneofs&&(C._permissions="permissions")),c.isPublished!=null&&c.hasOwnProperty("isPublished")&&(C.isPublished=c.isPublished,$.oneofs&&(C._isPublished="isPublished")),c.behavior!=null&&c.hasOwnProperty("behavior")&&(C.behavior=c.behavior,$.oneofs&&(C._behavior="behavior")),c.channelCache!=null&&c.hasOwnProperty("channelCache")&&(C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(c.channelCache,$),$.oneofs&&(C._channelCache="channelCache")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.User"},f}(),D.DataChannelCacheInfo=function(){function f(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.channels=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if($)return"channels."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let c=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");c.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");c.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let C=0;C<i.channels.length;++C)$.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},f}(),D.DataChannel=function(){function f(i){if(i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.dataChannelName="",f.prototype.id=null;let k;return Object.defineProperty(f.prototype,"_id",{get:$util.oneOfGetter(k=["id"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){return $||($=$Writer.create()),c.dataChannelName!=null&&Object.hasOwnProperty.call(c,"dataChannelName")&&$.uint32(10).string(c.dataChannelName),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&$.uint32(16).int32(c.id),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.DataChannel;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.dataChannelName=c.string();break}case 2:{M.id=c.int32();break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){return typeof c!="object"||c===null?"object expected":c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&!$util.isString(c.dataChannelName)?"dataChannelName: string expected":c.id!=null&&c.hasOwnProperty("id")&&!$util.isInteger(c.id)?"id: integer expected":null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannel)return c;let $=new $root.com.quick.voice.proto.DataChannel;return c.dataChannelName!=null&&($.dataChannelName=String(c.dataChannelName)),c.id!=null&&($.id=c.id|0),$},f.toObject=function(c,$){$||($={});let C={};return $.defaults&&(C.dataChannelName=""),c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&(C.dataChannelName=c.dataChannelName),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id,$.oneofs&&(C._id="id")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannel"},f}(),D.Login=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.appid="",f.prototype.userId="",f.prototype.sdkToken="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&c.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(26).string(i.sdkToken),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Login;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.appid=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.sdkToken=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let c=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(c.appid=String(i.appid)),i.userId!=null&&(c.userId=String(i.userId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.appid="",$.userId="",$.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&($.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},f}(),D.Track=function(){function f(i){if(i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.mid="",f.prototype.trackName=null,f.prototype.location=null,f.prototype.userId=null,f.prototype.code=null,f.prototype.desc=null,f.prototype.type=null,f.prototype.isValid=null,f.prototype.simulcast=null;let k;return Object.defineProperty(f.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_simulcast",{get:$util.oneOfGetter(k=["simulcast"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){return $||($=$Writer.create()),c.mid!=null&&Object.hasOwnProperty.call(c,"mid")&&$.uint32(10).string(c.mid),c.trackName!=null&&Object.hasOwnProperty.call(c,"trackName")&&$.uint32(18).string(c.trackName),c.location!=null&&Object.hasOwnProperty.call(c,"location")&&$.uint32(26).string(c.location),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&$.uint32(34).string(c.userId),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&$.uint32(40).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&$.uint32(50).string(c.desc),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&$.uint32(56).int32(c.type),c.isValid!=null&&Object.hasOwnProperty.call(c,"isValid")&&$.uint32(64).bool(c.isValid),c.simulcast!=null&&Object.hasOwnProperty.call(c,"simulcast")&&$.uint32(74).string(c.simulcast),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.Track;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.mid=c.string();break}case 2:{M.trackName=c.string();break}case 3:{M.location=c.string();break}case 4:{M.userId=c.string();break}case 5:{M.code=c.int32();break}case 6:{M.desc=c.string();break}case 7:{M.type=c.int32();break}case 8:{M.isValid=c.bool();break}case 9:{M.simulcast=c.string();break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.mid!=null&&c.hasOwnProperty("mid")&&!$util.isString(c.mid))return"mid: string expected";if(c.trackName!=null&&c.hasOwnProperty("trackName")&&!$util.isString(c.trackName))return"trackName: string expected";if(c.location!=null&&c.hasOwnProperty("location")&&!$util.isString(c.location))return"location: string expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code))return"code: integer expected";if(c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc))return"desc: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return c.isValid!=null&&c.hasOwnProperty("isValid")&&typeof c.isValid!="boolean"?"isValid: boolean expected":c.simulcast!=null&&c.hasOwnProperty("simulcast")&&!$util.isString(c.simulcast)?"simulcast: string expected":null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.Track)return c;let $=new $root.com.quick.voice.proto.Track;switch(c.mid!=null&&($.mid=String(c.mid)),c.trackName!=null&&($.trackName=String(c.trackName)),c.location!=null&&($.location=String(c.location)),c.userId!=null&&($.userId=String(c.userId)),c.code!=null&&($.code=c.code|0),c.desc!=null&&($.desc=String(c.desc)),c.type){default:if(typeof c.type=="number"){$.type=c.type;break}break;case"Microphone":case 0:$.type=0;break;case"Camera":case 1:$.type=1;break;case"Screen":case 2:$.type=2;break;case"SystemVoice":case 3:$.type=3;break}return c.isValid!=null&&($.isValid=!!c.isValid),c.simulcast!=null&&($.simulcast=String(c.simulcast)),$},f.toObject=function(c,$){$||($={});let C={};return $.defaults&&(C.mid=""),c.mid!=null&&c.hasOwnProperty("mid")&&(C.mid=c.mid),c.trackName!=null&&c.hasOwnProperty("trackName")&&(C.trackName=c.trackName,$.oneofs&&(C._trackName="trackName")),c.location!=null&&c.hasOwnProperty("location")&&(C.location=c.location,$.oneofs&&(C._location="location")),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId,$.oneofs&&(C._userId="userId")),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,$.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,$.oneofs&&(C._desc="desc")),c.type!=null&&c.hasOwnProperty("type")&&(C.type=$.enums===String?$root.com.quick.voice.proto.TrackType[c.type]===void 0?c.type:$root.com.quick.voice.proto.TrackType[c.type]:c.type,$.oneofs&&(C._type="type")),c.isValid!=null&&c.hasOwnProperty("isValid")&&(C.isValid=c.isValid,$.oneofs&&(C._isValid="isValid")),c.simulcast!=null&&c.hasOwnProperty("simulcast")&&(C.simulcast=c.simulcast,$.oneofs&&(C._simulcast="simulcast")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.Track"},f}(),D.JoinReq=function(){function f(i){if(i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.roomId="",f.prototype.user=null,f.prototype.callType=0,f.prototype.token=null;let k;return Object.defineProperty(f.prototype,"_token",{get:$util.oneOfGetter(k=["token"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){return $||($=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&$.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,$.uint32(18).fork()).ldelim(),c.callType!=null&&Object.hasOwnProperty.call(c,"callType")&&$.uint32(24).int32(c.callType),c.token!=null&&Object.hasOwnProperty.call(c,"token")&&$.uint32(34).string(c.token),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.JoinReq;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.roomId=c.string();break}case 2:{M.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{M.callType=c.int32();break}case 4:{M.token=c.string();break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(c.user);if($)return"user."+$}if(c.callType!=null&&c.hasOwnProperty("callType"))switch(c.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return c.token!=null&&c.hasOwnProperty("token")&&!$util.isString(c.token)?"token: string expected":null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.JoinReq)return c;let $=new $root.com.quick.voice.proto.JoinReq;if(c.roomId!=null&&($.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(c.user)}switch(c.callType){default:if(typeof c.callType=="number"){$.callType=c.callType;break}break;case"Normal":case 0:$.callType=0;break;case"Meeting":case 1:$.callType=1;break;case"Live":case 2:$.callType=2;break}return c.token!=null&&($.token=String(c.token)),$},f.toObject=function(c,$){$||($={});let C={};return $.defaults&&(C.roomId="",C.user=null,C.callType=$.enums===String?"Normal":0),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,$)),c.callType!=null&&c.hasOwnProperty("callType")&&(C.callType=$.enums===String?$root.com.quick.voice.proto.CallType[c.callType]===void 0?c.callType:$root.com.quick.voice.proto.CallType[c.callType]:c.callType),c.token!=null&&c.hasOwnProperty("token")&&(C.token=c.token,$.oneofs&&(C._token="token")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.JoinReq"},f}(),D.JoinRsp=function(){function f(k){if(this.roomUsers=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.roomUsers=$util.emptyArray,f.prototype.callType=0,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let $=0;$<i.roomUsers.length;++$)$root.com.quick.voice.proto.User.encode(i.roomUsers[$],c.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&c.uint32(24).int32(i.callType),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{C.callType=i.int32();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if($)return"roomUsers."+$}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let c=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");c.roomUsers=[];for(let $=0;$<i.roomUsers.length;++$){if(typeof i.roomUsers[$]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");c.roomUsers[$]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[$])}}switch(i.callType){default:if(typeof i.callType=="number"){c.callType=i.callType;break}break;case"Normal":case 0:c.callType=0;break;case"Meeting":case 1:c.callType=1;break;case"Live":case 2:c.callType=2;break}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.roomUsers=[]),c.defaults&&($.roomId="",$.callType=c.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){$.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)$.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return i.callType!=null&&i.hasOwnProperty("callType")&&($.callType=c.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},f}(),D.JoinNotify=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let c=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},f}(),D.ConnectCFReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.sdp="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.sdp=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let c=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(c.sdp=String(i.sdp)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},f}(),D.ConnectCFRsp=function(){function f(k){if(this.subscribeUsers=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.remoteSdp="",f.prototype.subscribeUsers=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.subscribeUsers!=null&&i.subscribeUsers.length)for(let $=0;$<i.subscribeUsers.length;++$)$root.com.quick.voice.proto.User.encode(i.subscribeUsers[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ConnectCFRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.subscribeUsers&&C.subscribeUsers.length||(C.subscribeUsers=[]),C.subscribeUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.subscribeUsers!=null&&i.hasOwnProperty("subscribeUsers")){if(!Array.isArray(i.subscribeUsers))return"subscribeUsers: array expected";for(let c=0;c<i.subscribeUsers.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.subscribeUsers[c]);if($)return"subscribeUsers."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFRsp)return i;let c=new $root.com.quick.voice.proto.ConnectCFRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.subscribeUsers){if(!Array.isArray(i.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");c.subscribeUsers=[];for(let $=0;$<i.subscribeUsers.length;++$){if(typeof i.subscribeUsers[$]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");c.subscribeUsers[$]=$root.com.quick.voice.proto.User.fromObject(i.subscribeUsers[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.subscribeUsers=[]),c.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),i.subscribeUsers&&i.subscribeUsers.length){$.subscribeUsers=[];for(let C=0;C<i.subscribeUsers.length;++C)$.subscribeUsers[C]=$root.com.quick.voice.proto.User.toObject(i.subscribeUsers[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFRsp"},f}(),D.PublishReq=function(){function f(i){if(this.tracks=[],i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.sdp="",f.prototype.tracks=$util.emptyArray,f.prototype.callAction=0,f.prototype.recreate=null;let k;return Object.defineProperty(f.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){if($||($=$Writer.create()),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&$.uint32(10).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],$.uint32(18).fork()).ldelim();return c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&$.uint32(24).int32(c.callAction),c.recreate!=null&&Object.hasOwnProperty.call(c,"recreate")&&$.uint32(32).bool(c.recreate),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.PublishReq;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.sdp=c.string();break}case 2:{M.tracks&&M.tracks.length||(M.tracks=[]),M.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 3:{M.callAction=c.int32();break}case 4:{M.recreate=c.bool();break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let $=0;$<c.tracks.length;++$){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[$]);if(C)return"tracks."+C}}return c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction)?"callAction: integer expected":c.recreate!=null&&c.hasOwnProperty("recreate")&&typeof c.recreate!="boolean"?"recreate: boolean expected":null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishReq)return c;let $=new $root.com.quick.voice.proto.PublishReq;if(c.sdp!=null&&($.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");$.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");$.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return c.callAction!=null&&($.callAction=c.callAction|0),c.recreate!=null&&($.recreate=!!c.recreate),$},f.toObject=function(c,$){$||($={});let C={};if(($.arrays||$.defaults)&&(C.tracks=[]),$.defaults&&(C.sdp="",C.callAction=0),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let M=0;M<c.tracks.length;++M)C.tracks[M]=$root.com.quick.voice.proto.Track.toObject(c.tracks[M],$)}return c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction),c.recreate!=null&&c.hasOwnProperty("recreate")&&(C.recreate=c.recreate,$.oneofs&&(C._recreate="recreate")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishReq"},f}(),D.PublishRsp=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.remoteSdp="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PublishRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.remoteSdp=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp)?"remoteSdp: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PublishRsp)return i;let c=new $root.com.quick.voice.proto.PublishRsp;return i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PublishRsp"},f}(),D.PublishNotify=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PublishNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PublishNotify)return i;let c=new $root.com.quick.voice.proto.PublishNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PublishNotify"},f}(),D.SubscribeReq=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.users=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SubscribeReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.users[c]);if($)return"users."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SubscribeReq)return i;let c=new $root.com.quick.voice.proto.SubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");c.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SubscribeReq"},f}(),D.SubscribeRsp=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.remoteSdp="",f.prototype.users=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SubscribeRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.users[c]);if($)return"users."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SubscribeRsp)return i;let c=new $root.com.quick.voice.proto.SubscribeRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");c.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),c.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SubscribeRsp"},f}(),D.RenegotiateReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.userId="",f.prototype.sdp="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(18).string(i.sdp),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.sdp=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let c=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(c.userId=String(i.userId)),i.sdp!=null&&(c.sdp=String(i.sdp)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.userId="",$.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},f}(),D.QuitReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.userId="",f.prototype.roomId="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let c=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.userId="",$.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},f}(),D.QuitNotify=function(){function f(i){if(i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.roomId="",f.prototype.user=null,f.prototype.code=null,f.prototype.desc=null;let k;return Object.defineProperty(f.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){return $||($=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&$.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,$.uint32(18).fork()).ldelim(),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&$.uint32(24).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&$.uint32(34).string(c.desc),$},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.QuitNotify;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.roomId=c.string();break}case 2:{M.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{M.code=c.int32();break}case 4:{M.desc=c.string();break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(c.user);if($)return"user."+$}return c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code)?"code: integer expected":c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc)?"desc: string expected":null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.QuitNotify)return c;let $=new $root.com.quick.voice.proto.QuitNotify;if(c.roomId!=null&&($.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.code!=null&&($.code=c.code|0),c.desc!=null&&($.desc=String(c.desc)),$},f.toObject=function(c,$){$||($={});let C={};return $.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,$)),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,$.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,$.oneofs&&(C._desc="desc")),C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.QuitNotify"},f}(),D.TokenExpireNotify=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let c=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},f}(),D.UpdateTokenReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.sdkToken="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(18).string(i.sdkToken),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.sdkToken=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let c=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},f}(),D.NetQualityChange=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.userId="",f.prototype.roomId="",f.prototype.egress=0,f.prototype.ingress=0,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&c.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&c.uint32(32).int32(i.ingress),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}case 3:{C.egress=i.int32();break}case 4:{C.ingress=i.int32();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let c=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),i.egress!=null&&(c.egress=i.egress|0),i.ingress!=null&&(c.ingress=i.ingress|0),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.userId="",$.roomId="",$.egress=0,$.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&($.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&($.ingress=i.ingress),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},f}(),D.NetQualityNotify=function(){function f(k){if(this.qualities=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.qualities=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let $=0;$<i.qualities.length;++$)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.qualities&&C.qualities.length||(C.qualities=[]),C.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let c=0;c<i.qualities.length;++c){let $=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[c]);if($)return"qualities."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let c=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");c.qualities=[];for(let $=0;$<i.qualities.length;++$){if(typeof i.qualities[$]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");c.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.qualities=[]),i.qualities&&i.qualities.length){$.qualities=[];for(let C=0;C<i.qualities.length;++C)$.qualities[C]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},f}(),D.UpdateCall=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let c=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},f}(),D.SyncRoomInfoReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},f}(),D.SyncRoomInfoRsp=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.isValid=!1,f.prototype.users=$util.emptyArray,f.prototype.isActive=!1,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&c.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],c.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&c.uint32(32).bool(i.isActive),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.isValid=i.bool();break}case 3:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{C.isActive=i.bool();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.users[c]);if($)return"users."+$}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.isValid!=null&&(c.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");c.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return i.isActive!=null&&(c.isActive=!!i.isActive),c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),c.defaults&&($.roomId="",$.isValid=!1,$.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&($.isValid=i.isValid),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&($.isActive=i.isActive),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},f}(),D.UpdateTime=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(8).int64(i.time),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.time=i.int64();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let c=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),c},f.toObject=function(i,c){c||(c={});let $={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);$.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.time=c.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=c.longs===String?String(i.time):i.time:$.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},f}(),D.CloseTrackReq=function(){function f(k){if(this.tracks=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.sdp="",f.prototype.tracks=$util.emptyArray,f.prototype.roomId="",f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],c.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(26).string(i.roomId),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.sdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if($)return"tracks."+$}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let c=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(c.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");c.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");c.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return i.roomId!=null&&(c.roomId=String(i.roomId)),c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.tracks=[]),c.defaults&&($.sdp="",$.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),i.tracks&&i.tracks.length){$.tracks=[];for(let C=0;C<i.tracks.length;++C)$.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},f}(),D.CloseTrackRsp=function(){function f(k){if(this.tracks=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.remoteSdp="",f.prototype.tracks=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if($)return"tracks."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let c=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");c.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");c.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.tracks=[]),c.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){$.tracks=[];for(let C=0;C<i.tracks.length;++C)$.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},f}(),D.CloseTrackNotify=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(10).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let c=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.user=null),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},f}(),D.ToggleLiveRoomReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return i;let c=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ToggleLiveRoomReq"},f}(),D.ToggleLiveRoomRsq=function(){function f(k){if(this.roomUsers=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.hash="",f.prototype.roomUsers=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.hash!=null&&Object.hasOwnProperty.call(i,"hash")&&c.uint32(18).string(i.hash),i.roomUsers!=null&&i.roomUsers.length)for(let $=0;$<i.roomUsers.length;++$)$root.com.quick.voice.proto.User.encode(i.roomUsers[$],c.uint32(26).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.hash=i.string();break}case 3:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.hash!=null&&i.hasOwnProperty("hash")&&!$util.isString(i.hash))return"hash: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if($)return"roomUsers."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return i;let c=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.hash!=null&&(c.hash=String(i.hash)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");c.roomUsers=[];for(let $=0;$<i.roomUsers.length;++$){if(typeof i.roomUsers[$]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");c.roomUsers[$]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.roomUsers=[]),c.defaults&&($.roomId="",$.hash=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.hash!=null&&i.hasOwnProperty("hash")&&($.hash=i.hash),i.roomUsers&&i.roomUsers.length){$.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)$.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ToggleLiveRoomRsq"},f}(),D.TrackType=function(){const f={},k=Object.create(f);return k[f[0]="Microphone"]=0,k[f[1]="Camera"]=1,k[f[2]="Screen"]=2,k[f[3]="SystemVoice"]=3,k}(),D.ReportInfoReq=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.actionEvent="",f.prototype.userId="",f.prototype.platform="",f.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,f.prototype.actionData="",f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.actionEvent!=null&&Object.hasOwnProperty.call(i,"actionEvent")&&c.uint32(10).string(i.actionEvent),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.platform!=null&&Object.hasOwnProperty.call(i,"platform")&&c.uint32(26).string(i.platform),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.actionData!=null&&Object.hasOwnProperty.call(i,"actionData")&&c.uint32(42).string(i.actionData),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ReportInfoReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.actionEvent=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.platform=i.string();break}case 4:{C.time=i.int64();break}case 5:{C.actionData=i.string();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){return typeof i!="object"||i===null?"object expected":i.actionEvent!=null&&i.hasOwnProperty("actionEvent")&&!$util.isString(i.actionEvent)?"actionEvent: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.platform!=null&&i.hasOwnProperty("platform")&&!$util.isString(i.platform)?"platform: string expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.actionData!=null&&i.hasOwnProperty("actionData")&&!$util.isString(i.actionData)?"actionData: string expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportInfoReq)return i;let c=new $root.com.quick.voice.proto.ReportInfoReq;return i.actionEvent!=null&&(c.actionEvent=String(i.actionEvent)),i.userId!=null&&(c.userId=String(i.userId)),i.platform!=null&&(c.platform=String(i.platform)),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.actionData!=null&&(c.actionData=String(i.actionData)),c},f.toObject=function(i,c){c||(c={});let $={};if(c.defaults){if($.actionEvent="",$.userId="",$.platform="",$util.Long){let C=new $util.Long(0,0,!1);$.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else $.time=c.longs===String?"0":0;$.actionData=""}return i.actionEvent!=null&&i.hasOwnProperty("actionEvent")&&($.actionEvent=i.actionEvent),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.platform!=null&&i.hasOwnProperty("platform")&&($.platform=i.platform),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=c.longs===String?String(i.time):i.time:$.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.actionData!=null&&i.hasOwnProperty("actionData")&&($.actionData=i.actionData),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportInfoReq"},f}(),D.UpdatePermissions=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.user=null,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let c=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},f}(),D.CallType=function(){const f={},k=Object.create(f);return k[f[0]="Normal"]=0,k[f[1]="Meeting"]=1,k[f[2]="Live"]=2,k}(),D.QuitNotifyCode=function(){const f={},k=Object.create(f);return k[f[0]="NormalQuit"]=0,k[f[2021]="Timeout"]=2021,k[f[2011]="TokenExpired"]=2011,k[f[2022]="KickOut"]=2022,k[f[2023]="EndPk"]=2023,k[f[2024]="EndLive"]=2024,k}(),D.UserBehavior=function(){function f(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.type=0,f.prototype.behavior=!1,f.create=function(i){return new f(i)},f.encode=function(i,c){return c||(c=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&c.uint32(16).bool(i.behavior),c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.type=i.int32();break}case 2:{C.behavior=i.bool();break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let c=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Microphone":case 0:c.type=0;break;case"Camera":case 1:c.type=1;break;case"Screen":case 2:c.type=2;break;case"SystemVoice":case 3:c.type=3;break}return i.behavior!=null&&(c.behavior=!!i.behavior),c},f.toObject=function(i,c){c||(c={});let $={};return c.defaults&&($.type=c.enums===String?"Microphone":0,$.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&($.type=c.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&($.behavior=i.behavior),$},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},f}(),D.PreventUser=function(){function f(k){if(this.behaviors=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.id="",f.prototype.behaviors=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&c.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let $=0;$<i.behaviors.length;++$)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.id=i.string();break}case 2:{C.behaviors&&C.behaviors.length||(C.behaviors=[]),C.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let c=0;c<i.behaviors.length;++c){let $=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[c]);if($)return"behaviors."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let c=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(c.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");c.behaviors=[];for(let $=0;$<i.behaviors.length;++$){if(typeof i.behaviors[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");c.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.behaviors=[]),c.defaults&&($.id=""),i.id!=null&&i.hasOwnProperty("id")&&($.id=i.id),i.behaviors&&i.behaviors.length){$.behaviors=[];for(let C=0;C<i.behaviors.length;++C)$.behaviors[C]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},f}(),D.PreventUsersBehaviorReq=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.users=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.PreventUser.encode(i.users[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.PreventUser.verify(i.users[c]);if($)return"users."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");c.users[$]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),c.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},f}(),D.PreventUsersBehaviorNotify=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.roomId="",f.prototype.users=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.User.verify(i.users[c]);if($)return"users."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");c.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),c.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},f}(),D.AccelerationAreas=function(){const f={},k=Object.create(f);return k[f[0]="chinaMainland"]=0,k[f[1]="global"]=1,k[f[2]="overseas"]=2,k}(),D.CountMethods=function(){const f={},k=Object.create(f);return k[f[0]="flow"]=0,k[f[1]="minutes"]=1,k}(),D.BaseCDNAddress=function(){function f(k){if(this.urlMap={},k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.area=0,f.prototype.countType=0,f.prototype.urlMap=$util.emptyObject,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&c.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&c.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let $=Object.keys(i.urlMap),C=0;C<$.length;++C)c.uint32(26).fork().uint32(10).string($[C]).uint32(18).string(i.urlMap[$[C]]).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.BaseCDNAddress,M,J;for(;i.pos<$;){let Z=i.uint32();switch(Z>>>3){case 1:{C.area=i.int32();break}case 2:{C.countType=i.int32();break}case 3:{C.urlMap===$util.emptyObject&&(C.urlMap={});let z=i.uint32()+i.pos;for(M="",J="";i.pos<z;){let X=i.uint32();switch(X>>>3){case 1:M=i.string();break;case 2:J=i.string();break;default:i.skipType(X&7);break}}C.urlMap[M]=J;break}default:i.skipType(Z&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let c=Object.keys(i.urlMap);for(let $=0;$<c.length;++$)if(!$util.isString(i.urlMap[c[$]]))return"urlMap: string{k:string} expected"}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let c=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){c.area=i.area;break}break;case"chinaMainland":case 0:c.area=0;break;case"global":case 1:c.area=1;break;case"overseas":case 2:c.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){c.countType=i.countType;break}break;case"flow":case 0:c.countType=0;break;case"minutes":case 1:c.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");c.urlMap={};for(let $=Object.keys(i.urlMap),C=0;C<$.length;++C)c.urlMap[$[C]]=String(i.urlMap[$[C]])}return c},f.toObject=function(i,c){c||(c={});let $={};(c.objects||c.defaults)&&($.urlMap={}),c.defaults&&($.area=c.enums===String?"chinaMainland":0,$.countType=c.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&($.area=c.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&($.countType=c.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let C;if(i.urlMap&&(C=Object.keys(i.urlMap)).length){$.urlMap={};for(let M=0;M<C.length;++M)$.urlMap[C[M]]=i.urlMap[C[M]]}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},f}(),D.CDNPlayAddressNotify=function(){function f(i){if(this.standLines=[],i)for(let c=Object.keys(i),$=0;$<c.length;++$)i[c[$]]!=null&&(this[c[$]]=i[c[$]])}f.prototype.roomId="",f.prototype.m3u8=null,f.prototype.rtmp=null,f.prototype.flv=null,f.prototype.rtmps=null,f.prototype.mainLine=null,f.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(f.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(f.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),f.create=function(c){return new f(c)},f.encode=function(c,$){if($||($=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&$.uint32(10).string(c.roomId),c.m3u8!=null&&Object.hasOwnProperty.call(c,"m3u8")&&$.uint32(18).string(c.m3u8),c.rtmp!=null&&Object.hasOwnProperty.call(c,"rtmp")&&$.uint32(26).string(c.rtmp),c.flv!=null&&Object.hasOwnProperty.call(c,"flv")&&$.uint32(34).string(c.flv),c.rtmps!=null&&Object.hasOwnProperty.call(c,"rtmps")&&$.uint32(42).string(c.rtmps),c.mainLine!=null&&Object.hasOwnProperty.call(c,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(c.mainLine,$.uint32(50).fork()).ldelim(),c.standLines!=null&&c.standLines.length)for(let C=0;C<c.standLines.length;++C)$root.com.quick.voice.proto.BaseCDNAddress.encode(c.standLines[C],$.uint32(58).fork()).ldelim();return $},f.encodeDelimited=function(c,$){return this.encode(c,$).ldelim()},f.decode=function(c,$){c instanceof $Reader||(c=$Reader.create(c));let C=$===void 0?c.len:c.pos+$,M=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;c.pos<C;){let J=c.uint32();switch(J>>>3){case 1:{M.roomId=c.string();break}case 2:{M.m3u8=c.string();break}case 3:{M.rtmp=c.string();break}case 4:{M.flv=c.string();break}case 5:{M.rtmps=c.string();break}case 6:{M.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32());break}case 7:{M.standLines&&M.standLines.length||(M.standLines=[]),M.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32()));break}default:c.skipType(J&7);break}}return M},f.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},f.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.m3u8!=null&&c.hasOwnProperty("m3u8")&&!$util.isString(c.m3u8))return"m3u8: string expected";if(c.rtmp!=null&&c.hasOwnProperty("rtmp")&&!$util.isString(c.rtmp))return"rtmp: string expected";if(c.flv!=null&&c.hasOwnProperty("flv")&&!$util.isString(c.flv))return"flv: string expected";if(c.rtmps!=null&&c.hasOwnProperty("rtmps")&&!$util.isString(c.rtmps))return"rtmps: string expected";if(c.mainLine!=null&&c.hasOwnProperty("mainLine")){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.mainLine);if($)return"mainLine."+$}if(c.standLines!=null&&c.hasOwnProperty("standLines")){if(!Array.isArray(c.standLines))return"standLines: array expected";for(let $=0;$<c.standLines.length;++$){let C=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.standLines[$]);if(C)return"standLines."+C}}return null},f.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return c;let $=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(c.roomId!=null&&($.roomId=String(c.roomId)),c.m3u8!=null&&($.m3u8=String(c.m3u8)),c.rtmp!=null&&($.rtmp=String(c.rtmp)),c.flv!=null&&($.flv=String(c.flv)),c.rtmps!=null&&($.rtmps=String(c.rtmps)),c.mainLine!=null){if(typeof c.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");$.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.mainLine)}if(c.standLines){if(!Array.isArray(c.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");$.standLines=[];for(let C=0;C<c.standLines.length;++C){if(typeof c.standLines[C]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");$.standLines[C]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.standLines[C])}}return $},f.toObject=function(c,$){$||($={});let C={};if(($.arrays||$.defaults)&&(C.standLines=[]),$.defaults&&(C.roomId=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.m3u8!=null&&c.hasOwnProperty("m3u8")&&(C.m3u8=c.m3u8,$.oneofs&&(C._m3u8="m3u8")),c.rtmp!=null&&c.hasOwnProperty("rtmp")&&(C.rtmp=c.rtmp,$.oneofs&&(C._rtmp="rtmp")),c.flv!=null&&c.hasOwnProperty("flv")&&(C.flv=c.flv,$.oneofs&&(C._flv="flv")),c.rtmps!=null&&c.hasOwnProperty("rtmps")&&(C.rtmps=c.rtmps,$.oneofs&&(C._rtmps="rtmps")),c.mainLine!=null&&c.hasOwnProperty("mainLine")&&(C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.mainLine,$),$.oneofs&&(C._mainLine="mainLine")),c.standLines&&c.standLines.length){C.standLines=[];for(let M=0;M<c.standLines.length;++M)C.standLines[M]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.standLines[M],$)}return C},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.CDNPlayAddressNotify"},f}(),D.UserChannel=function(){function f(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.userId="",f.prototype.channels=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],c.uint32(18).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if($)return"channels."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let c=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(c.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");c.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");c.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.channels=[]),c.defaults&&($.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.channels&&i.channels.length){$.channels=[];for(let C=0;C<i.channels.length;++C)$.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},f}(),D.ChannelPublishReq=function(){function f(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.channels=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if($)return"channels."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");c.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");c.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let C=0;C<i.channels.length;++C)$.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},f}(),D.ChannelPublishRsq=function(){function f(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.channels=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if($)return"channels."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");c.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");c.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let C=0;C<i.channels.length;++C)$.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},f}(),D.ChannelSubscribeReq=function(){function f(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.users=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.users[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let $=$root.com.quick.voice.proto.UserChannel.verify(i.users[c]);if($)return"users."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");c.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");c.users[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.users=[]),i.users&&i.users.length){$.users=[];for(let C=0;C<i.users.length;++C)$.users[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},f}(),D.ChannelSubscribeRsq=function(){function f(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return f.prototype.channels=$util.emptyArray,f.create=function(i){return new f(i)},f.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],c.uint32(10).fork()).ldelim();return c},f.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},f.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let $=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<$;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},f.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},f.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if($)return"channels."+$}}return null},f.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");c.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");c.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return c},f.toObject=function(i,c){c||(c={});let $={};if((c.arrays||c.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let C=0;C<i.channels.length;++C)$.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return $},f.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},f.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},f}(),D}(),I}(),N}(),O})(),enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",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(O){let N=O.length;for(;--N>=0;)O[N]=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(O,N,I,D,f){this.static_tree=O,this.extra_bits=N,this.extra_base=I,this.elems=D,this.max_length=f,this.has_stree=O&&O.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(O,N){this.dyn_tree=O,this.max_code=0,this.stat_desc=N}const d_code=O=>O<256?_dist_code[O]:_dist_code[256+(O>>>7)],put_short=(O,N)=>{O.pending_buf[O.pending++]=N&255,O.pending_buf[O.pending++]=N>>>8&255},send_bits=(O,N,I)=>{O.bi_valid>Buf_size-I?(O.bi_buf|=N<<O.bi_valid&65535,put_short(O,O.bi_buf),O.bi_buf=N>>Buf_size-O.bi_valid,O.bi_valid+=I-Buf_size):(O.bi_buf|=N<<O.bi_valid&65535,O.bi_valid+=I)},send_code=(O,N,I)=>{send_bits(O,I[N*2],I[N*2+1])},bi_reverse=(O,N)=>{let I=0;do I|=O&1,O>>>=1,I<<=1;while(--N>0);return I>>>1},bi_flush=O=>{O.bi_valid===16?(put_short(O,O.bi_buf),O.bi_buf=0,O.bi_valid=0):O.bi_valid>=8&&(O.pending_buf[O.pending++]=O.bi_buf&255,O.bi_buf>>=8,O.bi_valid-=8)},gen_bitlen=(O,N)=>{const I=N.dyn_tree,D=N.max_code,f=N.stat_desc.static_tree,k=N.stat_desc.has_stree,i=N.stat_desc.extra_bits,c=N.stat_desc.extra_base,$=N.stat_desc.max_length;let C,M,J,Z,z,X,re=0;for(Z=0;Z<=MAX_BITS$1;Z++)O.bl_count[Z]=0;for(I[O.heap[O.heap_max]*2+1]=0,C=O.heap_max+1;C<HEAP_SIZE$1;C++)M=O.heap[C],Z=I[I[M*2+1]*2+1]+1,Z>$&&(Z=$,re++),I[M*2+1]=Z,!(M>D)&&(O.bl_count[Z]++,z=0,M>=c&&(z=i[M-c]),X=I[M*2],O.opt_len+=X*(Z+z),k&&(O.static_len+=X*(f[M*2+1]+z)));if(re!==0){do{for(Z=$-1;O.bl_count[Z]===0;)Z--;O.bl_count[Z]--,O.bl_count[Z+1]+=2,O.bl_count[$]--,re-=2}while(re>0);for(Z=$;Z!==0;Z--)for(M=O.bl_count[Z];M!==0;)J=O.heap[--C],!(J>D)&&(I[J*2+1]!==Z&&(O.opt_len+=(Z-I[J*2+1])*I[J*2],I[J*2+1]=Z),M--)}},gen_codes=(O,N,I)=>{const D=new Array(MAX_BITS$1+1);let f=0,k,i;for(k=1;k<=MAX_BITS$1;k++)f=f+I[k-1]<<1,D[k]=f;for(i=0;i<=N;i++){let c=O[i*2+1];c!==0&&(O[i*2]=bi_reverse(D[c]++,c))}},tr_static_init=()=>{let O,N,I,D,f;const k=new Array(MAX_BITS$1+1);for(I=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=I,O=0;O<1<<extra_lbits[D];O++)_length_code[I++]=D;for(_length_code[I-1]=D,f=0,D=0;D<16;D++)for(base_dist[D]=f,O=0;O<1<<extra_dbits[D];O++)_dist_code[f++]=D;for(f>>=7;D<D_CODES$1;D++)for(base_dist[D]=f<<7,O=0;O<1<<extra_dbits[D]-7;O++)_dist_code[256+f++]=D;for(N=0;N<=MAX_BITS$1;N++)k[N]=0;for(O=0;O<=143;)static_ltree[O*2+1]=8,O++,k[8]++;for(;O<=255;)static_ltree[O*2+1]=9,O++,k[9]++;for(;O<=279;)static_ltree[O*2+1]=7,O++,k[7]++;for(;O<=287;)static_ltree[O*2+1]=8,O++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),O=0;O<D_CODES$1;O++)static_dtree[O*2+1]=5,static_dtree[O*2]=bi_reverse(O,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=O=>{let N;for(N=0;N<L_CODES$1;N++)O.dyn_ltree[N*2]=0;for(N=0;N<D_CODES$1;N++)O.dyn_dtree[N*2]=0;for(N=0;N<BL_CODES$1;N++)O.bl_tree[N*2]=0;O.dyn_ltree[END_BLOCK*2]=1,O.opt_len=O.static_len=0,O.sym_next=O.matches=0},bi_windup=O=>{O.bi_valid>8?put_short(O,O.bi_buf):O.bi_valid>0&&(O.pending_buf[O.pending++]=O.bi_buf),O.bi_buf=0,O.bi_valid=0},smaller=(O,N,I,D)=>{const f=N*2,k=I*2;return O[f]<O[k]||O[f]===O[k]&&D[N]<=D[I]},pqdownheap=(O,N,I)=>{const D=O.heap[I];let f=I<<1;for(;f<=O.heap_len&&(f<O.heap_len&&smaller(N,O.heap[f+1],O.heap[f],O.depth)&&f++,!smaller(N,D,O.heap[f],O.depth));)O.heap[I]=O.heap[f],I=f,f<<=1;O.heap[I]=D},compress_block=(O,N,I)=>{let D,f,k=0,i,c;if(O.sym_next!==0)do D=O.pending_buf[O.sym_buf+k++]&255,D+=(O.pending_buf[O.sym_buf+k++]&255)<<8,f=O.pending_buf[O.sym_buf+k++],D===0?send_code(O,f,N):(i=_length_code[f],send_code(O,i+LITERALS$1+1,N),c=extra_lbits[i],c!==0&&(f-=base_length[i],send_bits(O,f,c)),D--,i=d_code(D),send_code(O,i,I),c=extra_dbits[i],c!==0&&(D-=base_dist[i],send_bits(O,D,c)));while(k<O.sym_next);send_code(O,END_BLOCK,N)},build_tree=(O,N)=>{const I=N.dyn_tree,D=N.stat_desc.static_tree,f=N.stat_desc.has_stree,k=N.stat_desc.elems;let i,c,$=-1,C;for(O.heap_len=0,O.heap_max=HEAP_SIZE$1,i=0;i<k;i++)I[i*2]!==0?(O.heap[++O.heap_len]=$=i,O.depth[i]=0):I[i*2+1]=0;for(;O.heap_len<2;)C=O.heap[++O.heap_len]=$<2?++$:0,I[C*2]=1,O.depth[C]=0,O.opt_len--,f&&(O.static_len-=D[C*2+1]);for(N.max_code=$,i=O.heap_len>>1;i>=1;i--)pqdownheap(O,I,i);C=k;do i=O.heap[1],O.heap[1]=O.heap[O.heap_len--],pqdownheap(O,I,1),c=O.heap[1],O.heap[--O.heap_max]=i,O.heap[--O.heap_max]=c,I[C*2]=I[i*2]+I[c*2],O.depth[C]=(O.depth[i]>=O.depth[c]?O.depth[i]:O.depth[c])+1,I[i*2+1]=I[c*2+1]=C,O.heap[1]=C++,pqdownheap(O,I,1);while(O.heap_len>=2);O.heap[--O.heap_max]=O.heap[1],gen_bitlen(O,N),gen_codes(I,$,O.bl_count)},scan_tree=(O,N,I)=>{let D,f=-1,k,i=N[0*2+1],c=0,$=7,C=4;for(i===0&&($=138,C=3),N[(I+1)*2+1]=65535,D=0;D<=I;D++)k=i,i=N[(D+1)*2+1],!(++c<$&&k===i)&&(c<C?O.bl_tree[k*2]+=c:k!==0?(k!==f&&O.bl_tree[k*2]++,O.bl_tree[REP_3_6*2]++):c<=10?O.bl_tree[REPZ_3_10*2]++:O.bl_tree[REPZ_11_138*2]++,c=0,f=k,i===0?($=138,C=3):k===i?($=6,C=3):($=7,C=4))},send_tree=(O,N,I)=>{let D,f=-1,k,i=N[0*2+1],c=0,$=7,C=4;for(i===0&&($=138,C=3),D=0;D<=I;D++)if(k=i,i=N[(D+1)*2+1],!(++c<$&&k===i)){if(c<C)do send_code(O,k,O.bl_tree);while(--c!==0);else k!==0?(k!==f&&(send_code(O,k,O.bl_tree),c--),send_code(O,REP_3_6,O.bl_tree),send_bits(O,c-3,2)):c<=10?(send_code(O,REPZ_3_10,O.bl_tree),send_bits(O,c-3,3)):(send_code(O,REPZ_11_138,O.bl_tree),send_bits(O,c-11,7));c=0,f=k,i===0?($=138,C=3):k===i?($=6,C=3):($=7,C=4)}},build_bl_tree=O=>{let N;for(scan_tree(O,O.dyn_ltree,O.l_desc.max_code),scan_tree(O,O.dyn_dtree,O.d_desc.max_code),build_tree(O,O.bl_desc),N=BL_CODES$1-1;N>=3&&O.bl_tree[bl_order[N]*2+1]===0;N--);return O.opt_len+=3*(N+1)+5+5+4,N},send_all_trees=(O,N,I,D)=>{let f;for(send_bits(O,N-257,5),send_bits(O,I-1,5),send_bits(O,D-4,4),f=0;f<D;f++)send_bits(O,O.bl_tree[bl_order[f]*2+1],3);send_tree(O,O.dyn_ltree,N-1),send_tree(O,O.dyn_dtree,I-1)},detect_data_type=O=>{let N=4093624447,I;for(I=0;I<=31;I++,N>>>=1)if(N&1&&O.dyn_ltree[I*2]!==0)return Z_BINARY;if(O.dyn_ltree[9*2]!==0||O.dyn_ltree[10*2]!==0||O.dyn_ltree[13*2]!==0)return Z_TEXT;for(I=32;I<LITERALS$1;I++)if(O.dyn_ltree[I*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=O=>{static_init_done||(tr_static_init(),static_init_done=!0),O.l_desc=new TreeDesc(O.dyn_ltree,static_l_desc),O.d_desc=new TreeDesc(O.dyn_dtree,static_d_desc),O.bl_desc=new TreeDesc(O.bl_tree,static_bl_desc),O.bi_buf=0,O.bi_valid=0,init_block(O)},_tr_stored_block$1=(O,N,I,D)=>{send_bits(O,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(O),put_short(O,I),put_short(O,~I),I&&O.pending_buf.set(O.window.subarray(N,N+I),O.pending),O.pending+=I},_tr_align$1=O=>{send_bits(O,STATIC_TREES<<1,3),send_code(O,END_BLOCK,static_ltree),bi_flush(O)},_tr_flush_block$1=(O,N,I,D)=>{let f,k,i=0;O.level>0?(O.strm.data_type===Z_UNKNOWN$1&&(O.strm.data_type=detect_data_type(O)),build_tree(O,O.l_desc),build_tree(O,O.d_desc),i=build_bl_tree(O),f=O.opt_len+3+7>>>3,k=O.static_len+3+7>>>3,k<=f&&(f=k)):f=k=I+5,I+4<=f&&N!==-1?_tr_stored_block$1(O,N,I,D):O.strategy===Z_FIXED$1||k===f?(send_bits(O,(STATIC_TREES<<1)+(D?1:0),3),compress_block(O,static_ltree,static_dtree)):(send_bits(O,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(O,O.l_desc.max_code+1,O.d_desc.max_code+1,i+1),compress_block(O,O.dyn_ltree,O.dyn_dtree)),init_block(O),D&&bi_windup(O)},_tr_tally$1=(O,N,I)=>(O.pending_buf[O.sym_buf+O.sym_next++]=N,O.pending_buf[O.sym_buf+O.sym_next++]=N>>8,O.pending_buf[O.sym_buf+O.sym_next++]=I,N===0?O.dyn_ltree[I*2]++:(O.matches++,N--,O.dyn_ltree[(_length_code[I]+LITERALS$1+1)*2]++,O.dyn_dtree[d_code(N)*2]++),O.sym_next===O.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=(O,N,I,D)=>{let f=O&65535|0,k=O>>>16&65535|0,i=0;for(;I!==0;){i=I>2e3?2e3:I,I-=i;do f=f+N[D++]|0,k=k+f|0;while(--i);f%=65521,k%=65521}return f|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let O,N=[];for(var I=0;I<256;I++){O=I;for(var D=0;D<8;D++)O=O&1?3988292384^O>>>1:O>>>1;N[I]=O}return N},crcTable=new Uint32Array(makeTable()),crc32=(O,N,I,D)=>{const f=crcTable,k=D+I;O^=-1;for(let i=D;i<k;i++)O=O>>>8^f[(O^N[i])&255];return O^-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=(O,N)=>(O.msg=messages[N],N),rank=O=>O*2-(O>4?9:0),zero=O=>{let N=O.length;for(;--N>=0;)O[N]=0},slide_hash=O=>{let N,I,D,f=O.w_size;N=O.hash_size,D=N;do I=O.head[--D],O.head[D]=I>=f?I-f:0;while(--N);N=f,D=N;do I=O.prev[--D],O.prev[D]=I>=f?I-f:0;while(--N)};let HASH_ZLIB=(O,N,I)=>(N<<O.hash_shift^I)&O.hash_mask,HASH=HASH_ZLIB;const flush_pending=O=>{const N=O.state;let I=N.pending;I>O.avail_out&&(I=O.avail_out),I!==0&&(O.output.set(N.pending_buf.subarray(N.pending_out,N.pending_out+I),O.next_out),O.next_out+=I,N.pending_out+=I,O.total_out+=I,O.avail_out-=I,N.pending-=I,N.pending===0&&(N.pending_out=0))},flush_block_only=(O,N)=>{_tr_flush_block(O,O.block_start>=0?O.block_start:-1,O.strstart-O.block_start,N),O.block_start=O.strstart,flush_pending(O.strm)},put_byte=(O,N)=>{O.pending_buf[O.pending++]=N},putShortMSB=(O,N)=>{O.pending_buf[O.pending++]=N>>>8&255,O.pending_buf[O.pending++]=N&255},read_buf=(O,N,I,D)=>{let f=O.avail_in;return f>D&&(f=D),f===0?0:(O.avail_in-=f,N.set(O.input.subarray(O.next_in,O.next_in+f),I),O.state.wrap===1?O.adler=adler32_1(O.adler,N,f,I):O.state.wrap===2&&(O.adler=crc32_1(O.adler,N,f,I)),O.next_in+=f,O.total_in+=f,f)},longest_match=(O,N)=>{let I=O.max_chain_length,D=O.strstart,f,k,i=O.prev_length,c=O.nice_match;const $=O.strstart>O.w_size-MIN_LOOKAHEAD?O.strstart-(O.w_size-MIN_LOOKAHEAD):0,C=O.window,M=O.w_mask,J=O.prev,Z=O.strstart+MAX_MATCH;let z=C[D+i-1],X=C[D+i];O.prev_length>=O.good_match&&(I>>=2),c>O.lookahead&&(c=O.lookahead);do if(f=N,!(C[f+i]!==X||C[f+i-1]!==z||C[f]!==C[D]||C[++f]!==C[D+1])){D+=2,f++;do;while(C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&C[++D]===C[++f]&&D<Z);if(k=MAX_MATCH-(Z-D),D=Z-MAX_MATCH,k>i){if(O.match_start=N,i=k,k>=c)break;z=C[D+i-1],X=C[D+i]}}while((N=J[N&M])>$&&--I!==0);return i<=O.lookahead?i:O.lookahead},fill_window=O=>{const N=O.w_size;let I,D,f;do{if(D=O.window_size-O.lookahead-O.strstart,O.strstart>=N+(N-MIN_LOOKAHEAD)&&(O.window.set(O.window.subarray(N,N+N-D),0),O.match_start-=N,O.strstart-=N,O.block_start-=N,O.insert>O.strstart&&(O.insert=O.strstart),slide_hash(O),D+=N),O.strm.avail_in===0)break;if(I=read_buf(O.strm,O.window,O.strstart+O.lookahead,D),O.lookahead+=I,O.lookahead+O.insert>=MIN_MATCH)for(f=O.strstart-O.insert,O.ins_h=O.window[f],O.ins_h=HASH(O,O.ins_h,O.window[f+1]);O.insert&&(O.ins_h=HASH(O,O.ins_h,O.window[f+MIN_MATCH-1]),O.prev[f&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=f,f++,O.insert--,!(O.lookahead+O.insert<MIN_MATCH)););}while(O.lookahead<MIN_LOOKAHEAD&&O.strm.avail_in!==0)},deflate_stored=(O,N)=>{let I=O.pending_buf_size-5>O.w_size?O.w_size:O.pending_buf_size-5,D,f,k,i=0,c=O.strm.avail_in;do{if(D=65535,k=O.bi_valid+42>>3,O.strm.avail_out<k||(k=O.strm.avail_out-k,f=O.strstart-O.block_start,D>f+O.strm.avail_in&&(D=f+O.strm.avail_in),D>k&&(D=k),D<I&&(D===0&&N!==Z_FINISH$3||N===Z_NO_FLUSH$2||D!==f+O.strm.avail_in)))break;i=N===Z_FINISH$3&&D===f+O.strm.avail_in?1:0,_tr_stored_block(O,0,0,i),O.pending_buf[O.pending-4]=D,O.pending_buf[O.pending-3]=D>>8,O.pending_buf[O.pending-2]=~D,O.pending_buf[O.pending-1]=~D>>8,flush_pending(O.strm),f&&(f>D&&(f=D),O.strm.output.set(O.window.subarray(O.block_start,O.block_start+f),O.strm.next_out),O.strm.next_out+=f,O.strm.avail_out-=f,O.strm.total_out+=f,O.block_start+=f,D-=f),D&&(read_buf(O.strm,O.strm.output,O.strm.next_out,D),O.strm.next_out+=D,O.strm.avail_out-=D,O.strm.total_out+=D)}while(i===0);return c-=O.strm.avail_in,c&&(c>=O.w_size?(O.matches=2,O.window.set(O.strm.input.subarray(O.strm.next_in-O.w_size,O.strm.next_in),0),O.strstart=O.w_size,O.insert=O.strstart):(O.window_size-O.strstart<=c&&(O.strstart-=O.w_size,O.window.set(O.window.subarray(O.w_size,O.w_size+O.strstart),0),O.matches<2&&O.matches++,O.insert>O.strstart&&(O.insert=O.strstart)),O.window.set(O.strm.input.subarray(O.strm.next_in-c,O.strm.next_in),O.strstart),O.strstart+=c,O.insert+=c>O.w_size-O.insert?O.w_size-O.insert:c),O.block_start=O.strstart),O.high_water<O.strstart&&(O.high_water=O.strstart),i?BS_FINISH_DONE:N!==Z_NO_FLUSH$2&&N!==Z_FINISH$3&&O.strm.avail_in===0&&O.strstart===O.block_start?BS_BLOCK_DONE:(k=O.window_size-O.strstart,O.strm.avail_in>k&&O.block_start>=O.w_size&&(O.block_start-=O.w_size,O.strstart-=O.w_size,O.window.set(O.window.subarray(O.w_size,O.w_size+O.strstart),0),O.matches<2&&O.matches++,k+=O.w_size,O.insert>O.strstart&&(O.insert=O.strstart)),k>O.strm.avail_in&&(k=O.strm.avail_in),k&&(read_buf(O.strm,O.window,O.strstart,k),O.strstart+=k,O.insert+=k>O.w_size-O.insert?O.w_size-O.insert:k),O.high_water<O.strstart&&(O.high_water=O.strstart),k=O.bi_valid+42>>3,k=O.pending_buf_size-k>65535?65535:O.pending_buf_size-k,I=k>O.w_size?O.w_size:k,f=O.strstart-O.block_start,(f>=I||(f||N===Z_FINISH$3)&&N!==Z_NO_FLUSH$2&&O.strm.avail_in===0&&f<=k)&&(D=f>k?k:f,i=N===Z_FINISH$3&&O.strm.avail_in===0&&D===f?1:0,_tr_stored_block(O,O.block_start,D,i),O.block_start+=D,flush_pending(O.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(O,N)=>{let I,D;for(;;){if(O.lookahead<MIN_LOOKAHEAD){if(fill_window(O),O.lookahead<MIN_LOOKAHEAD&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if(I=0,O.lookahead>=MIN_MATCH&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),I=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),I!==0&&O.strstart-I<=O.w_size-MIN_LOOKAHEAD&&(O.match_length=longest_match(O,I)),O.match_length>=MIN_MATCH)if(D=_tr_tally(O,O.strstart-O.match_start,O.match_length-MIN_MATCH),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=MIN_MATCH){O.match_length--;do O.strstart++,O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),I=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart;while(--O.match_length!==0);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+1]);else D=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(D&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=O.strstart<MIN_MATCH-1?O.strstart:MIN_MATCH-1,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(O,N)=>{let I,D,f;for(;;){if(O.lookahead<MIN_LOOKAHEAD){if(fill_window(O),O.lookahead<MIN_LOOKAHEAD&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if(I=0,O.lookahead>=MIN_MATCH&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),I=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=MIN_MATCH-1,I!==0&&O.prev_length<O.max_lazy_match&&O.strstart-I<=O.w_size-MIN_LOOKAHEAD&&(O.match_length=longest_match(O,I),O.match_length<=5&&(O.strategy===Z_FILTERED||O.match_length===MIN_MATCH&&O.strstart-O.match_start>4096)&&(O.match_length=MIN_MATCH-1)),O.prev_length>=MIN_MATCH&&O.match_length<=O.prev_length){f=O.strstart+O.lookahead-MIN_MATCH,D=_tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-MIN_MATCH),O.lookahead-=O.prev_length-1,O.prev_length-=2;do++O.strstart<=f&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),I=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart);while(--O.prev_length!==0);if(O.match_available=0,O.match_length=MIN_MATCH-1,O.strstart++,D&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}else if(O.match_available){if(D=_tr_tally(O,0,O.window[O.strstart-1]),D&&flush_block_only(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return BS_NEED_MORE}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(D=_tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<MIN_MATCH-1?O.strstart:MIN_MATCH-1,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(O,N)=>{let I,D,f,k;const i=O.window;for(;;){if(O.lookahead<=MAX_MATCH){if(fill_window(O),O.lookahead<=MAX_MATCH&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=MIN_MATCH&&O.strstart>0&&(f=O.strstart-1,D=i[f],D===i[++f]&&D===i[++f]&&D===i[++f])){k=O.strstart+MAX_MATCH;do;while(D===i[++f]&&D===i[++f]&&D===i[++f]&&D===i[++f]&&D===i[++f]&&D===i[++f]&&D===i[++f]&&D===i[++f]&&f<k);O.match_length=MAX_MATCH-(k-f),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=MIN_MATCH?(I=_tr_tally(O,1,O.match_length-MIN_MATCH),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):(I=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),I&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=0,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(O,N)=>{let I;for(;;){if(O.lookahead===0&&(fill_window(O),O.lookahead===0)){if(N===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(O.match_length=0,I=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,I&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=0,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(O,N,I,D,f){this.good_length=O,this.max_lazy=N,this.nice_length=I,this.max_chain=D,this.func=f}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=O=>{O.window_size=2*O.w_size,zero(O.head),O.max_lazy_match=configuration_table[O.level].max_lazy,O.good_match=configuration_table[O.level].good_length,O.nice_match=configuration_table[O.level].nice_length,O.max_chain_length=configuration_table[O.level].max_chain,O.strstart=0,O.block_start=0,O.lookahead=0,O.insert=0,O.match_length=O.prev_length=MIN_MATCH-1,O.match_available=0,O.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=O=>{if(!O)return 1;const N=O.state;return!N||N.strm!==O||N.status!==INIT_STATE&&N.status!==GZIP_STATE&&N.status!==EXTRA_STATE&&N.status!==NAME_STATE&&N.status!==COMMENT_STATE&&N.status!==HCRC_STATE&&N.status!==BUSY_STATE&&N.status!==FINISH_STATE?1:0},deflateResetKeep=O=>{if(deflateStateCheck(O))return err(O,Z_STREAM_ERROR$2);O.total_in=O.total_out=0,O.data_type=Z_UNKNOWN;const N=O.state;return N.pending=0,N.pending_out=0,N.wrap<0&&(N.wrap=-N.wrap),N.status=N.wrap===2?GZIP_STATE:N.wrap?INIT_STATE:BUSY_STATE,O.adler=N.wrap===2?0:1,N.last_flush=-2,_tr_init(N),Z_OK$3},deflateReset=O=>{const N=deflateResetKeep(O);return N===Z_OK$3&&lm_init(O.state),N},deflateSetHeader=(O,N)=>deflateStateCheck(O)||O.state.wrap!==2?Z_STREAM_ERROR$2:(O.state.gzhead=N,Z_OK$3),deflateInit2=(O,N,I,D,f,k)=>{if(!O)return Z_STREAM_ERROR$2;let i=1;if(N===Z_DEFAULT_COMPRESSION$1&&(N=6),D<0?(i=0,D=-D):D>15&&(i=2,D-=16),f<1||f>MAX_MEM_LEVEL||I!==Z_DEFLATED$2||D<8||D>15||N<0||N>9||k<0||k>Z_FIXED||D===8&&i!==1)return err(O,Z_STREAM_ERROR$2);D===8&&(D=9);const c=new DeflateState;return O.state=c,c.strm=O,c.status=INIT_STATE,c.wrap=i,c.gzhead=null,c.w_bits=D,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=f+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+MIN_MATCH-1)/MIN_MATCH),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<f+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=N,c.strategy=k,c.method=I,deflateReset(O)},deflateInit=(O,N)=>deflateInit2(O,N,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(O,N)=>{if(deflateStateCheck(O)||N>Z_BLOCK$1||N<0)return O?err(O,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const I=O.state;if(!O.output||O.avail_in!==0&&!O.input||I.status===FINISH_STATE&&N!==Z_FINISH$3)return err(O,O.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=I.last_flush;if(I.last_flush=N,I.pending!==0){if(flush_pending(O),O.avail_out===0)return I.last_flush=-1,Z_OK$3}else if(O.avail_in===0&&rank(N)<=rank(D)&&N!==Z_FINISH$3)return err(O,Z_BUF_ERROR$1);if(I.status===FINISH_STATE&&O.avail_in!==0)return err(O,Z_BUF_ERROR$1);if(I.status===INIT_STATE&&I.wrap===0&&(I.status=BUSY_STATE),I.status===INIT_STATE){let f=Z_DEFLATED$2+(I.w_bits-8<<4)<<8,k=-1;if(I.strategy>=Z_HUFFMAN_ONLY||I.level<2?k=0:I.level<6?k=1:I.level===6?k=2:k=3,f|=k<<6,I.strstart!==0&&(f|=PRESET_DICT),f+=31-f%31,putShortMSB(I,f),I.strstart!==0&&(putShortMSB(I,O.adler>>>16),putShortMSB(I,O.adler&65535)),O.adler=1,I.status=BUSY_STATE,flush_pending(O),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(I.status===GZIP_STATE){if(O.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&&(O.adler=crc32_1(O.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(O),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(I.status===EXTRA_STATE){if(I.gzhead.extra){let f=I.pending,k=(I.gzhead.extra.length&65535)-I.gzindex;for(;I.pending+k>I.pending_buf_size;){let c=I.pending_buf_size-I.pending;if(I.pending_buf.set(I.gzhead.extra.subarray(I.gzindex,I.gzindex+c),I.pending),I.pending=I.pending_buf_size,I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f)),I.gzindex+=c,flush_pending(O),I.pending!==0)return I.last_flush=-1,Z_OK$3;f=0,k-=c}let i=new Uint8Array(I.gzhead.extra);I.pending_buf.set(i.subarray(I.gzindex,I.gzindex+k),I.pending),I.pending+=k,I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f)),I.gzindex=0}I.status=NAME_STATE}if(I.status===NAME_STATE){if(I.gzhead.name){let f=I.pending,k;do{if(I.pending===I.pending_buf_size){if(I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f)),flush_pending(O),I.pending!==0)return I.last_flush=-1,Z_OK$3;f=0}I.gzindex<I.gzhead.name.length?k=I.gzhead.name.charCodeAt(I.gzindex++)&255:k=0,put_byte(I,k)}while(k!==0);I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f)),I.gzindex=0}I.status=COMMENT_STATE}if(I.status===COMMENT_STATE){if(I.gzhead.comment){let f=I.pending,k;do{if(I.pending===I.pending_buf_size){if(I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f)),flush_pending(O),I.pending!==0)return I.last_flush=-1,Z_OK$3;f=0}I.gzindex<I.gzhead.comment.length?k=I.gzhead.comment.charCodeAt(I.gzindex++)&255:k=0,put_byte(I,k)}while(k!==0);I.gzhead.hcrc&&I.pending>f&&(O.adler=crc32_1(O.adler,I.pending_buf,I.pending-f,f))}I.status=HCRC_STATE}if(I.status===HCRC_STATE){if(I.gzhead.hcrc){if(I.pending+2>I.pending_buf_size&&(flush_pending(O),I.pending!==0))return I.last_flush=-1,Z_OK$3;put_byte(I,O.adler&255),put_byte(I,O.adler>>8&255),O.adler=0}if(I.status=BUSY_STATE,flush_pending(O),I.pending!==0)return I.last_flush=-1,Z_OK$3}if(O.avail_in!==0||I.lookahead!==0||N!==Z_NO_FLUSH$2&&I.status!==FINISH_STATE){let f=I.level===0?deflate_stored(I,N):I.strategy===Z_HUFFMAN_ONLY?deflate_huff(I,N):I.strategy===Z_RLE?deflate_rle(I,N):configuration_table[I.level].func(I,N);if((f===BS_FINISH_STARTED||f===BS_FINISH_DONE)&&(I.status=FINISH_STATE),f===BS_NEED_MORE||f===BS_FINISH_STARTED)return O.avail_out===0&&(I.last_flush=-1),Z_OK$3;if(f===BS_BLOCK_DONE&&(N===Z_PARTIAL_FLUSH?_tr_align(I):N!==Z_BLOCK$1&&(_tr_stored_block(I,0,0,!1),N===Z_FULL_FLUSH$1&&(zero(I.head),I.lookahead===0&&(I.strstart=0,I.block_start=0,I.insert=0))),flush_pending(O),O.avail_out===0))return I.last_flush=-1,Z_OK$3}return N!==Z_FINISH$3?Z_OK$3:I.wrap<=0?Z_STREAM_END$3:(I.wrap===2?(put_byte(I,O.adler&255),put_byte(I,O.adler>>8&255),put_byte(I,O.adler>>16&255),put_byte(I,O.adler>>24&255),put_byte(I,O.total_in&255),put_byte(I,O.total_in>>8&255),put_byte(I,O.total_in>>16&255),put_byte(I,O.total_in>>24&255)):(putShortMSB(I,O.adler>>>16),putShortMSB(I,O.adler&65535)),flush_pending(O),I.wrap>0&&(I.wrap=-I.wrap),I.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=O=>{if(deflateStateCheck(O))return Z_STREAM_ERROR$2;const N=O.state.status;return O.state=null,N===BUSY_STATE?err(O,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(O,N)=>{let I=N.length;if(deflateStateCheck(O))return Z_STREAM_ERROR$2;const D=O.state,f=D.wrap;if(f===2||f===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if(f===1&&(O.adler=adler32_1(O.adler,N,I,0)),D.wrap=0,I>=D.w_size){f===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let $=new Uint8Array(D.w_size);$.set(N.subarray(I-D.w_size,I),0),N=$,I=D.w_size}const k=O.avail_in,i=O.next_in,c=O.input;for(O.avail_in=I,O.next_in=0,O.input=N,fill_window(D);D.lookahead>=MIN_MATCH;){let $=D.strstart,C=D.lookahead-(MIN_MATCH-1);do D.ins_h=HASH(D,D.ins_h,D.window[$+MIN_MATCH-1]),D.prev[$&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=$,$++;while(--C);D.strstart=$,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,O.next_in=i,O.input=c,O.avail_in=k,D.wrap=f,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=(O,N)=>Object.prototype.hasOwnProperty.call(O,N);var assign=function(O){const N=Array.prototype.slice.call(arguments,1);for(;N.length;){const I=N.shift();if(I){if(typeof I!="object")throw new TypeError(I+"must be non-object");for(const D in I)_has(I,D)&&(O[D]=I[D])}}return O},flattenChunks=O=>{let N=0;for(let D=0,f=O.length;D<f;D++)N+=O[D].length;const I=new Uint8Array(N);for(let D=0,f=0,k=O.length;D<k;D++){let i=O[D];I.set(i,f),f+=i.length}return I},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(O){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let O=0;O<256;O++)_utf8len[O]=O>=252?6:O>=248?5:O>=240?4:O>=224?3:O>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=O=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(O);let N,I,D,f,k,i=O.length,c=0;for(f=0;f<i;f++)I=O.charCodeAt(f),(I&64512)===55296&&f+1<i&&(D=O.charCodeAt(f+1),(D&64512)===56320&&(I=65536+(I-55296<<10)+(D-56320),f++)),c+=I<128?1:I<2048?2:I<65536?3:4;for(N=new Uint8Array(c),k=0,f=0;k<c;f++)I=O.charCodeAt(f),(I&64512)===55296&&f+1<i&&(D=O.charCodeAt(f+1),(D&64512)===56320&&(I=65536+(I-55296<<10)+(D-56320),f++)),I<128?N[k++]=I:I<2048?(N[k++]=192|I>>>6,N[k++]=128|I&63):I<65536?(N[k++]=224|I>>>12,N[k++]=128|I>>>6&63,N[k++]=128|I&63):(N[k++]=240|I>>>18,N[k++]=128|I>>>12&63,N[k++]=128|I>>>6&63,N[k++]=128|I&63);return N};const buf2binstring=(O,N)=>{if(N<65534&&O.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,O.length===N?O:O.subarray(0,N));let I="";for(let D=0;D<N;D++)I+=String.fromCharCode(O[D]);return I};var buf2string=(O,N)=>{const I=N||O.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(O.subarray(0,N));let D,f;const k=new Array(I*2);for(f=0,D=0;D<I;){let i=O[D++];if(i<128){k[f++]=i;continue}let c=_utf8len[i];if(c>4){k[f++]=65533,D+=c-1;continue}for(i&=c===2?31:c===3?15:7;c>1&&D<I;)i=i<<6|O[D++]&63,c--;if(c>1){k[f++]=65533;continue}i<65536?k[f++]=i:(i-=65536,k[f++]=55296|i>>10&1023,k[f++]=56320|i&1023)}return buf2binstring(k,f)},utf8border=(O,N)=>{N=N||O.length,N>O.length&&(N=O.length);let I=N-1;for(;I>=0&&(O[I]&192)===128;)I--;return I<0||I===0?N:I+_utf8len[O[I]]>N?I:N},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(O){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},O||{});let N=this.options;N.raw&&N.windowBits>0?N.windowBits=-N.windowBits:N.gzip&&N.windowBits>0&&N.windowBits<16&&(N.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,N.level,N.method,N.windowBits,N.memLevel,N.strategy);if(I!==Z_OK$2)throw new Error(messages[I]);if(N.header&&deflate_1$2.deflateSetHeader(this.strm,N.header),N.dictionary){let D;if(typeof N.dictionary=="string"?D=strings.string2buf(N.dictionary):toString$1.call(N.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(N.dictionary):D=N.dictionary,I=deflate_1$2.deflateSetDictionary(this.strm,D),I!==Z_OK$2)throw new Error(messages[I]);this._dict_set=!0}}Deflate$1.prototype.push=function(O,N){const I=this.strm,D=this.options.chunkSize;let f,k;if(this.ended)return!1;for(N===~~N?k=N:k=N===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof O=="string"?I.input=strings.string2buf(O):toString$1.call(O)==="[object ArrayBuffer]"?I.input=new Uint8Array(O):I.input=O,I.next_in=0,I.avail_in=I.input.length;;){if(I.avail_out===0&&(I.output=new Uint8Array(D),I.next_out=0,I.avail_out=D),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&I.avail_out<=6){this.onData(I.output.subarray(0,I.next_out)),I.avail_out=0;continue}if(f=deflate_1$2.deflate(I,k),f===Z_STREAM_END$2)return I.next_out>0&&this.onData(I.output.subarray(0,I.next_out)),f=deflate_1$2.deflateEnd(this.strm),this.onEnd(f),this.ended=!0,f===Z_OK$2;if(I.avail_out===0){this.onData(I.output);continue}if(k>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(O){this.chunks.push(O)},Deflate$1.prototype.onEnd=function(O){O===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=O,this.msg=this.strm.msg};function deflate$1(O,N){const I=new Deflate$1(N);if(I.push(O,!0),I.err)throw I.msg||messages[I.err];return I.result}function deflateRaw$1(O,N){return N=N||{},N.raw=!0,deflate$1(O,N)}function gzip$1(O,N){return N=N||{},N.gzip=!0,deflate$1(O,N)}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 O(N,I){let D,f,k,i,c,$,C,M,J,Z,z,X,re,oe,ne,de,ye,Q,ae,he,se,fe,me,ee;const le=N.state;D=N.next_in,me=N.input,f=D+(N.avail_in-5),k=N.next_out,ee=N.output,i=k-(I-N.avail_out),c=k+(N.avail_out-257),$=le.dmax,C=le.wsize,M=le.whave,J=le.wnext,Z=le.window,z=le.hold,X=le.bits,re=le.lencode,oe=le.distcode,ne=(1<<le.lenbits)-1,de=(1<<le.distbits)-1;e:do{X<15&&(z+=me[D++]<<X,X+=8,z+=me[D++]<<X,X+=8),ye=re[z&ne];t:for(;;){if(Q=ye>>>24,z>>>=Q,X-=Q,Q=ye>>>16&255,Q===0)ee[k++]=ye&65535;else if(Q&16){ae=ye&65535,Q&=15,Q&&(X<Q&&(z+=me[D++]<<X,X+=8),ae+=z&(1<<Q)-1,z>>>=Q,X-=Q),X<15&&(z+=me[D++]<<X,X+=8,z+=me[D++]<<X,X+=8),ye=oe[z&de];n:for(;;){if(Q=ye>>>24,z>>>=Q,X-=Q,Q=ye>>>16&255,Q&16){if(he=ye&65535,Q&=15,X<Q&&(z+=me[D++]<<X,X+=8,X<Q&&(z+=me[D++]<<X,X+=8)),he+=z&(1<<Q)-1,he>$){N.msg="invalid distance too far back",le.mode=BAD$1;break e}if(z>>>=Q,X-=Q,Q=k-i,he>Q){if(Q=he-Q,Q>M&&le.sane){N.msg="invalid distance too far back",le.mode=BAD$1;break e}if(se=0,fe=Z,J===0){if(se+=C-Q,Q<ae){ae-=Q;do ee[k++]=Z[se++];while(--Q);se=k-he,fe=ee}}else if(J<Q){if(se+=C+J-Q,Q-=J,Q<ae){ae-=Q;do ee[k++]=Z[se++];while(--Q);if(se=0,J<ae){Q=J,ae-=Q;do ee[k++]=Z[se++];while(--Q);se=k-he,fe=ee}}}else if(se+=J-Q,Q<ae){ae-=Q;do ee[k++]=Z[se++];while(--Q);se=k-he,fe=ee}for(;ae>2;)ee[k++]=fe[se++],ee[k++]=fe[se++],ee[k++]=fe[se++],ae-=3;ae&&(ee[k++]=fe[se++],ae>1&&(ee[k++]=fe[se++]))}else{se=k-he;do ee[k++]=ee[se++],ee[k++]=ee[se++],ee[k++]=ee[se++],ae-=3;while(ae>2);ae&&(ee[k++]=ee[se++],ae>1&&(ee[k++]=ee[se++]))}}else if((Q&64)===0){ye=oe[(ye&65535)+(z&(1<<Q)-1)];continue n}else{N.msg="invalid distance code",le.mode=BAD$1;break e}break}}else if((Q&64)===0){ye=re[(ye&65535)+(z&(1<<Q)-1)];continue t}else if(Q&32){le.mode=TYPE$1;break e}else{N.msg="invalid literal/length code",le.mode=BAD$1;break e}break}}while(D<f&&k<c);ae=X>>3,D-=ae,X-=ae<<3,z&=(1<<X)-1,N.next_in=D,N.next_out=k,N.avail_in=D<f?5+(f-D):5-(D-f),N.avail_out=k<c?257+(c-k):257-(k-c),le.hold=z,le.bits=X};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=(O,N,I,D,f,k,i,c)=>{const $=c.bits;let C=0,M=0,J=0,Z=0,z=0,X=0,re=0,oe=0,ne=0,de=0,ye,Q,ae,he,se,fe=null,me;const ee=new Uint16Array(MAXBITS+1),le=new Uint16Array(MAXBITS+1);let ve=null,be,ge,$e;for(C=0;C<=MAXBITS;C++)ee[C]=0;for(M=0;M<D;M++)ee[N[I+M]]++;for(z=$,Z=MAXBITS;Z>=1&&ee[Z]===0;Z--);if(z>Z&&(z=Z),Z===0)return f[k++]=1<<24|64<<16|0,f[k++]=1<<24|64<<16|0,c.bits=1,0;for(J=1;J<Z&&ee[J]===0;J++);for(z<J&&(z=J),oe=1,C=1;C<=MAXBITS;C++)if(oe<<=1,oe-=ee[C],oe<0)return-1;if(oe>0&&(O===CODES$1||Z!==1))return-1;for(le[1]=0,C=1;C<MAXBITS;C++)le[C+1]=le[C]+ee[C];for(M=0;M<D;M++)N[I+M]!==0&&(i[le[N[I+M]]++]=M);if(O===CODES$1?(fe=ve=i,me=20):O===LENS$1?(fe=lbase,ve=lext,me=257):(fe=dbase,ve=dext,me=0),de=0,M=0,C=J,se=k,X=z,re=0,ae=-1,ne=1<<z,he=ne-1,O===LENS$1&&ne>ENOUGH_LENS$1||O===DISTS$1&&ne>ENOUGH_DISTS$1)return 1;for(;;){be=C-re,i[M]+1<me?(ge=0,$e=i[M]):i[M]>=me?(ge=ve[i[M]-me],$e=fe[i[M]-me]):(ge=96,$e=0),ye=1<<C-re,Q=1<<X,J=Q;do Q-=ye,f[se+(de>>re)+Q]=be<<24|ge<<16|$e|0;while(Q!==0);for(ye=1<<C-1;de&ye;)ye>>=1;if(ye!==0?(de&=ye-1,de+=ye):de=0,M++,--ee[C]===0){if(C===Z)break;C=N[I+i[M]]}if(C>z&&(de&he)!==ae){for(re===0&&(re=z),se+=J,X=C-re,oe=1<<X;X+re<Z&&(oe-=ee[X+re],!(oe<=0));)X++,oe<<=1;if(ne+=1<<X,O===LENS$1&&ne>ENOUGH_LENS$1||O===DISTS$1&&ne>ENOUGH_DISTS$1)return 1;ae=de&he,f[ae]=z<<24|X<<16|se-k|0}}return de!==0&&(f[se+de]=C-re<<24|64<<16|0),c.bits=z,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=O=>(O>>>24&255)+(O>>>8&65280)+((O&65280)<<8)+((O&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=O=>{if(!O)return 1;const N=O.state;return!N||N.strm!==O||N.mode<HEAD||N.mode>SYNC?1:0},inflateResetKeep=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const N=O.state;return O.total_in=O.total_out=N.total=0,O.msg="",N.wrap&&(O.adler=N.wrap&1),N.mode=HEAD,N.last=0,N.havedict=0,N.flags=-1,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new Int32Array(ENOUGH_LENS),N.distcode=N.distdyn=new Int32Array(ENOUGH_DISTS),N.sane=1,N.back=-1,Z_OK$1},inflateReset=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const N=O.state;return N.wsize=0,N.whave=0,N.wnext=0,inflateResetKeep(O)},inflateReset2=(O,N)=>{let I;if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const D=O.state;return N<0?(I=0,N=-N):(I=(N>>4)+5,N<48&&(N&=15)),N&&(N<8||N>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==N&&(D.window=null),D.wrap=I,D.wbits=N,inflateReset(O))},inflateInit2=(O,N)=>{if(!O)return Z_STREAM_ERROR$1;const I=new InflateState;O.state=I,I.strm=O,I.window=null,I.mode=HEAD;const D=inflateReset2(O,N);return D!==Z_OK$1&&(O.state=null),D},inflateInit=O=>inflateInit2(O,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=O=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let N=0;for(;N<144;)O.lens[N++]=8;for(;N<256;)O.lens[N++]=9;for(;N<280;)O.lens[N++]=7;for(;N<288;)O.lens[N++]=8;for(inftrees(LENS,O.lens,0,288,lenfix,0,O.work,{bits:9}),N=0;N<32;)O.lens[N++]=5;inftrees(DISTS,O.lens,0,32,distfix,0,O.work,{bits:5}),virgin=!1}O.lencode=lenfix,O.lenbits=9,O.distcode=distfix,O.distbits=5},updatewindow=(O,N,I,D)=>{let f;const k=O.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(N.subarray(I-k.wsize,I),0),k.wnext=0,k.whave=k.wsize):(f=k.wsize-k.wnext,f>D&&(f=D),k.window.set(N.subarray(I-D,I-D+f),k.wnext),D-=f,D?(k.window.set(N.subarray(I-D,I),0),k.wnext=D,k.whave=k.wsize):(k.wnext+=f,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=f))),0},inflate$2=(O,N)=>{let I,D,f,k,i,c,$,C,M,J,Z,z,X,re,oe=0,ne,de,ye,Q,ae,he,se,fe;const me=new Uint8Array(4);let ee,le;const ve=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(O)||!O.output||!O.input&&O.avail_in!==0)return Z_STREAM_ERROR$1;I=O.state,I.mode===TYPE&&(I.mode=TYPEDO),i=O.next_out,f=O.output,$=O.avail_out,k=O.next_in,D=O.input,c=O.avail_in,C=I.hold,M=I.bits,J=c,Z=$,fe=Z_OK$1;e:for(;;)switch(I.mode){case HEAD:if(I.wrap===0){I.mode=TYPEDO;break}for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(I.wrap&2&&C===35615){I.wbits===0&&(I.wbits=15),I.check=0,me[0]=C&255,me[1]=C>>>8&255,I.check=crc32_1(I.check,me,2,0),C=0,M=0,I.mode=FLAGS;break}if(I.head&&(I.head.done=!1),!(I.wrap&1)||(((C&255)<<8)+(C>>8))%31){O.msg="incorrect header check",I.mode=BAD;break}if((C&15)!==Z_DEFLATED){O.msg="unknown compression method",I.mode=BAD;break}if(C>>>=4,M-=4,se=(C&15)+8,I.wbits===0&&(I.wbits=se),se>15||se>I.wbits){O.msg="invalid window size",I.mode=BAD;break}I.dmax=1<<I.wbits,I.flags=0,O.adler=I.check=1,I.mode=C&512?DICTID:TYPE,C=0,M=0;break;case FLAGS:for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(I.flags=C,(I.flags&255)!==Z_DEFLATED){O.msg="unknown compression method",I.mode=BAD;break}if(I.flags&57344){O.msg="unknown header flags set",I.mode=BAD;break}I.head&&(I.head.text=C>>8&1),I.flags&512&&I.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,I.check=crc32_1(I.check,me,2,0)),C=0,M=0,I.mode=TIME;case TIME:for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.head&&(I.head.time=C),I.flags&512&&I.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,me[2]=C>>>16&255,me[3]=C>>>24&255,I.check=crc32_1(I.check,me,4,0)),C=0,M=0,I.mode=OS;case OS:for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.head&&(I.head.xflags=C&255,I.head.os=C>>8),I.flags&512&&I.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,I.check=crc32_1(I.check,me,2,0)),C=0,M=0,I.mode=EXLEN;case EXLEN:if(I.flags&1024){for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.length=C,I.head&&(I.head.extra_len=C),I.flags&512&&I.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,I.check=crc32_1(I.check,me,2,0)),C=0,M=0}else I.head&&(I.head.extra=null);I.mode=EXTRA;case EXTRA:if(I.flags&1024&&(z=I.length,z>c&&(z=c),z&&(I.head&&(se=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Uint8Array(I.head.extra_len)),I.head.extra.set(D.subarray(k,k+z),se)),I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,D,z,k)),c-=z,k+=z,I.length-=z),I.length))break e;I.length=0,I.mode=NAME;case NAME:if(I.flags&2048){if(c===0)break e;z=0;do se=D[k+z++],I.head&&se&&I.length<65536&&(I.head.name+=String.fromCharCode(se));while(se&&z<c);if(I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,D,z,k)),c-=z,k+=z,se)break e}else I.head&&(I.head.name=null);I.length=0,I.mode=COMMENT;case COMMENT:if(I.flags&4096){if(c===0)break e;z=0;do se=D[k+z++],I.head&&se&&I.length<65536&&(I.head.comment+=String.fromCharCode(se));while(se&&z<c);if(I.flags&512&&I.wrap&4&&(I.check=crc32_1(I.check,D,z,k)),c-=z,k+=z,se)break e}else I.head&&(I.head.comment=null);I.mode=HCRC;case HCRC:if(I.flags&512){for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(I.wrap&4&&C!==(I.check&65535)){O.msg="header crc mismatch",I.mode=BAD;break}C=0,M=0}I.head&&(I.head.hcrc=I.flags>>9&1,I.head.done=!0),O.adler=I.check=0,I.mode=TYPE;break;case DICTID:for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}O.adler=I.check=zswap32(C),C=0,M=0,I.mode=DICT;case DICT:if(I.havedict===0)return O.next_out=i,O.avail_out=$,O.next_in=k,O.avail_in=c,I.hold=C,I.bits=M,Z_NEED_DICT$1;O.adler=I.check=1,I.mode=TYPE;case TYPE:if(N===Z_BLOCK||N===Z_TREES)break e;case TYPEDO:if(I.last){C>>>=M&7,M-=M&7,I.mode=CHECK;break}for(;M<3;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}switch(I.last=C&1,C>>>=1,M-=1,C&3){case 0:I.mode=STORED;break;case 1:if(fixedtables(I),I.mode=LEN_,N===Z_TREES){C>>>=2,M-=2;break e}break;case 2:I.mode=TABLE;break;case 3:O.msg="invalid block type",I.mode=BAD}C>>>=2,M-=2;break;case STORED:for(C>>>=M&7,M-=M&7;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if((C&65535)!==(C>>>16^65535)){O.msg="invalid stored block lengths",I.mode=BAD;break}if(I.length=C&65535,C=0,M=0,I.mode=COPY_,N===Z_TREES)break e;case COPY_:I.mode=COPY;case COPY:if(z=I.length,z){if(z>c&&(z=c),z>$&&(z=$),z===0)break e;f.set(D.subarray(k,k+z),i),c-=z,k+=z,$-=z,i+=z,I.length-=z;break}I.mode=TYPE;break;case TABLE:for(;M<14;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(I.nlen=(C&31)+257,C>>>=5,M-=5,I.ndist=(C&31)+1,C>>>=5,M-=5,I.ncode=(C&15)+4,C>>>=4,M-=4,I.nlen>286||I.ndist>30){O.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(;M<3;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.lens[ve[I.have++]]=C&7,C>>>=3,M-=3}for(;I.have<19;)I.lens[ve[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,ee={bits:I.lenbits},fe=inftrees(CODES,I.lens,0,19,I.lencode,0,I.work,ee),I.lenbits=ee.bits,fe){O.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(;oe=I.lencode[C&(1<<I.lenbits)-1],ne=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ne<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(ye<16)C>>>=ne,M-=ne,I.lens[I.have++]=ye;else{if(ye===16){for(le=ne+2;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(C>>>=ne,M-=ne,I.have===0){O.msg="invalid bit length repeat",I.mode=BAD;break}se=I.lens[I.have-1],z=3+(C&3),C>>>=2,M-=2}else if(ye===17){for(le=ne+3;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=ne,M-=ne,se=0,z=3+(C&7),C>>>=3,M-=3}else{for(le=ne+7;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=ne,M-=ne,se=0,z=11+(C&127),C>>>=7,M-=7}if(I.have+z>I.nlen+I.ndist){O.msg="invalid bit length repeat",I.mode=BAD;break}for(;z--;)I.lens[I.have++]=se}}if(I.mode===BAD)break;if(I.lens[256]===0){O.msg="invalid code -- missing end-of-block",I.mode=BAD;break}if(I.lenbits=9,ee={bits:I.lenbits},fe=inftrees(LENS,I.lens,0,I.nlen,I.lencode,0,I.work,ee),I.lenbits=ee.bits,fe){O.msg="invalid literal/lengths set",I.mode=BAD;break}if(I.distbits=6,I.distcode=I.distdyn,ee={bits:I.distbits},fe=inftrees(DISTS,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,ee),I.distbits=ee.bits,fe){O.msg="invalid distances set",I.mode=BAD;break}if(I.mode=LEN_,N===Z_TREES)break e;case LEN_:I.mode=LEN;case LEN:if(c>=6&&$>=258){O.next_out=i,O.avail_out=$,O.next_in=k,O.avail_in=c,I.hold=C,I.bits=M,inffast(O,Z),i=O.next_out,f=O.output,$=O.avail_out,k=O.next_in,D=O.input,c=O.avail_in,C=I.hold,M=I.bits,I.mode===TYPE&&(I.back=-1);break}for(I.back=0;oe=I.lencode[C&(1<<I.lenbits)-1],ne=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ne<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(de&&(de&240)===0){for(Q=ne,ae=de,he=ye;oe=I.lencode[he+((C&(1<<Q+ae)-1)>>Q)],ne=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(Q+ne<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=Q,M-=Q,I.back+=Q}if(C>>>=ne,M-=ne,I.back+=ne,I.length=ye,de===0){I.mode=LIT;break}if(de&32){I.back=-1,I.mode=TYPE;break}if(de&64){O.msg="invalid literal/length code",I.mode=BAD;break}I.extra=de&15,I.mode=LENEXT;case LENEXT:if(I.extra){for(le=I.extra;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.length+=C&(1<<I.extra)-1,C>>>=I.extra,M-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=DIST;case DIST:for(;oe=I.distcode[C&(1<<I.distbits)-1],ne=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ne<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if((de&240)===0){for(Q=ne,ae=de,he=ye;oe=I.distcode[he+((C&(1<<Q+ae)-1)>>Q)],ne=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(Q+ne<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=Q,M-=Q,I.back+=Q}if(C>>>=ne,M-=ne,I.back+=ne,de&64){O.msg="invalid distance code",I.mode=BAD;break}I.offset=ye,I.extra=de&15,I.mode=DISTEXT;case DISTEXT:if(I.extra){for(le=I.extra;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}I.offset+=C&(1<<I.extra)-1,C>>>=I.extra,M-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){O.msg="invalid distance too far back",I.mode=BAD;break}I.mode=MATCH;case MATCH:if($===0)break e;if(z=Z-$,I.offset>z){if(z=I.offset-z,z>I.whave&&I.sane){O.msg="invalid distance too far back",I.mode=BAD;break}z>I.wnext?(z-=I.wnext,X=I.wsize-z):X=I.wnext-z,z>I.length&&(z=I.length),re=I.window}else re=f,X=i-I.offset,z=I.length;z>$&&(z=$),$-=z,I.length-=z;do f[i++]=re[X++];while(--z);I.length===0&&(I.mode=LEN);break;case LIT:if($===0)break e;f[i++]=I.length,$--,I.mode=LEN;break;case CHECK:if(I.wrap){for(;M<32;){if(c===0)break e;c--,C|=D[k++]<<M,M+=8}if(Z-=$,O.total_out+=Z,I.total+=Z,I.wrap&4&&Z&&(O.adler=I.check=I.flags?crc32_1(I.check,f,Z,i-Z):adler32_1(I.check,f,Z,i-Z)),Z=$,I.wrap&4&&(I.flags?C:zswap32(C))!==I.check){O.msg="incorrect data check",I.mode=BAD;break}C=0,M=0}I.mode=LENGTH;case LENGTH:if(I.wrap&&I.flags){for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(I.wrap&4&&C!==(I.total&4294967295)){O.msg="incorrect length check",I.mode=BAD;break}C=0,M=0}I.mode=DONE;case DONE:fe=Z_STREAM_END$1;break e;case BAD:fe=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return O.next_out=i,O.avail_out=$,O.next_in=k,O.avail_in=c,I.hold=C,I.bits=M,(I.wsize||Z!==O.avail_out&&I.mode<BAD&&(I.mode<CHECK||N!==Z_FINISH$1))&&updatewindow(O,O.output,O.next_out,Z-O.avail_out),J-=O.avail_in,Z-=O.avail_out,O.total_in+=J,O.total_out+=Z,I.total+=Z,I.wrap&4&&Z&&(O.adler=I.check=I.flags?crc32_1(I.check,f,Z,O.next_out-Z):adler32_1(I.check,f,Z,O.next_out-Z)),O.data_type=I.bits+(I.last?64:0)+(I.mode===TYPE?128:0)+(I.mode===LEN_||I.mode===COPY_?256:0),(J===0&&Z===0||N===Z_FINISH$1)&&fe===Z_OK$1&&(fe=Z_BUF_ERROR),fe},inflateEnd=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;let N=O.state;return N.window&&(N.window=null),O.state=null,Z_OK$1},inflateGetHeader=(O,N)=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const I=O.state;return(I.wrap&2)===0?Z_STREAM_ERROR$1:(I.head=N,N.done=!1,Z_OK$1)},inflateSetDictionary=(O,N)=>{const I=N.length;let D,f,k;return inflateStateCheck(O)||(D=O.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&(f=1,f=adler32_1(f,N,I,0),f!==D.check)?Z_DATA_ERROR$1:(k=updatewindow(O,N,I,I),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(O){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},O||{});const N=this.options;N.raw&&N.windowBits>=0&&N.windowBits<16&&(N.windowBits=-N.windowBits,N.windowBits===0&&(N.windowBits=-15)),N.windowBits>=0&&N.windowBits<16&&!(O&&O.windowBits)&&(N.windowBits+=32),N.windowBits>15&&N.windowBits<48&&(N.windowBits&15)===0&&(N.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,N.windowBits);if(I!==Z_OK)throw new Error(messages[I]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),N.dictionary&&(typeof N.dictionary=="string"?N.dictionary=strings.string2buf(N.dictionary):toString.call(N.dictionary)==="[object ArrayBuffer]"&&(N.dictionary=new Uint8Array(N.dictionary)),N.raw&&(I=inflate_1$2.inflateSetDictionary(this.strm,N.dictionary),I!==Z_OK)))throw new Error(messages[I])}Inflate$1.prototype.push=function(O,N){const I=this.strm,D=this.options.chunkSize,f=this.options.dictionary;let k,i,c;if(this.ended)return!1;for(N===~~N?i=N:i=N===!0?Z_FINISH:Z_NO_FLUSH,toString.call(O)==="[object ArrayBuffer]"?I.input=new Uint8Array(O):I.input=O,I.next_in=0,I.avail_in=I.input.length;;){for(I.avail_out===0&&(I.output=new Uint8Array(D),I.next_out=0,I.avail_out=D),k=inflate_1$2.inflate(I,i),k===Z_NEED_DICT&&f&&(k=inflate_1$2.inflateSetDictionary(I,f),k===Z_OK?k=inflate_1$2.inflate(I,i):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));I.avail_in>0&&k===Z_STREAM_END&&I.state.wrap>0&&O[I.next_in]!==0;)inflate_1$2.inflateReset(I),k=inflate_1$2.inflate(I,i);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(c=I.avail_out,I.next_out&&(I.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let $=strings.utf8border(I.output,I.next_out),C=I.next_out-$,M=strings.buf2string(I.output,$);I.next_out=C,I.avail_out=D-C,C&&I.output.set(I.output.subarray($,$+C),0),this.onData(M)}else this.onData(I.output.length===I.next_out?I.output:I.output.subarray(0,I.next_out));if(!(k===Z_OK&&c===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if(I.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(O){this.chunks.push(O)},Inflate$1.prototype.onEnd=function(O){O===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=O,this.msg=this.strm.msg};function inflate$1(O,N){const I=new Inflate$1(N);if(I.push(O),I.err)throw I.msg||messages[I.err];return I.result}function inflateRaw$1(O,N){return N=N||{},N.raw=!0,inflate$1(O,N)}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 ignoreEvent=["updateSeverTime"];ignoreEvent.push("heartbeat"),ignoreEvent.push("heartbeatEx"),ignoreEvent.push("networkQualityChange"),ignoreEvent.push("onNetQuality"),ignoreEvent.push("updateCall"),ignoreEvent.push("pubNotify");const compressArrayBuffer=O=>{const N=new Uint8Array(O),I=pako.deflate(N,{gzip:!0});return new Uint8Array(I==null?void 0:I.buffer)},decompressArrayBuffer=O=>{const N=new Uint8Array(O),I=pako.inflate(N,{gzip:!0});return new Uint8Array(I==null?void 0:I.buffer)},sendMessageFormat=O=>{const{event:N}=O;switch(O.data_original=O.data,O.time&&(O.timeStr=E(O.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),N){case"login":O.data=com.quick.voice.proto.Login.encode(O.data).finish();break;case"joinRoom":case"joinRoomEx":O.data=com.quick.voice.proto.JoinReq.encode(O.data).finish();break;case"quitRoom":O.data=com.quick.voice.proto.QuitReq.encode(O.data).finish();break;case"connectCF":O.data=com.quick.voice.proto.ConnectCFReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"publish":O.data=com.quick.voice.proto.PublishReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"pubChannel":O.data=com.quick.voice.proto.ChannelPublishReq.encode(O.data).finish();break;case"subscribe":O.data=com.quick.voice.proto.SubscribeReq.encode(O.data).finish();break;case"subChannel":O.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(O.data).finish();break;case"closeTrack":O.data=com.quick.voice.proto.CloseTrackReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"renegotiate":O.data=com.quick.voice.proto.RenegotiateReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"syncRoomInfo":O.data=com.quick.voice.proto.SyncRoomInfoReq.encode(O.data).finish();break;case"updateCall":O.data=com.quick.voice.proto.UpdateCall.encode(O.data).finish();break;case"networkQualityChange":O.data=com.quick.voice.proto.NetQualityChange.encode(O.data).finish();break;case"pubNotify":O.data=com.quick.voice.proto.PublishNotify.encode(O.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":O.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(O.data).finish();break;default:O.data=new Uint8Array;break}return O},onMessageFormat=O=>{const{event:N,compress:I=!1}=O;if(O.data_remote=O.data,O.time&&(O.timeStr=E(O.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),I)try{O.data=decompressArrayBuffer(O.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(N){case"login":O.data=com.quick.voice.proto.Login.decode(O.data);break;case"joinRoom":case"joinRoomEx":O.data=com.quick.voice.proto.JoinRsp.decode(O.data);break;case"onJoinRoom":O.data=com.quick.voice.proto.JoinNotify.decode(O.data);break;case"onQuitRoom":O.data=com.quick.voice.proto.QuitNotify.decode(O.data);break;case"connectCF":O.data=com.quick.voice.proto.ConnectCFRsp.decode(O.data);break;case"publish":O.data=com.quick.voice.proto.PublishRsp.decode(O.data);break;case"pubChannel":O.data=com.quick.voice.proto.ChannelPublishRsq.decode(O.data);break;case"onPublish":O.data=com.quick.voice.proto.PublishNotify.decode(O.data);break;case"subscribe":O.data=com.quick.voice.proto.SubscribeRsp.decode(O.data);break;case"subChannel":O.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(O.data);break;case"closeTrack":O.data=com.quick.voice.proto.CloseTrackRsp.decode(O.data);break;case"onCloseTrack":O.data=com.quick.voice.proto.CloseTrackNotify.decode(O.data);break;case"onUpdateCall":O.data=com.quick.voice.proto.UpdateCall.decode(O.data);break;case"onDataChannelPublish":O.data=com.quick.voice.proto.UserChannel.decode(O.data);break;case"onDestroyRoom":O.data=com.quick.voice.proto.QuitNotify.decode(O.data);break;case"onUpdatePermissions":O.data=com.quick.voice.proto.UpdatePermissions.decode(O.data);break;case"onNetQuality":O.data=com.quick.voice.proto.NetQualityNotify.decode(O.data);break;case"syncRoomInfo":O.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(O.data);break;case"onCDNPlayUrlAdd":O.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(O.data);break;case"onUpdateBehavior":O.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(O.data);break;case"debugger":O.data=JSON.parse(new TextDecoder().decode(O.data));break}return O};class CallsWebSocket{constructor(N){_e(this,Ee);_e(this,we,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});_e(this,Me,"");_e(this,Ze,{});_e(this,Ge,{});ie(this,"state","closed");ie(this,"sendMessageBefore",async()=>{});ie(this,"onReconnectSuccess",N=>{});ie(this,"onReconnectStop",N=>{});_e(this,Pt,N=>{let I=!0;const{code:D=1e3}=N;return(D===1e3||D===4e3)&&(I=!1),this.state="connecting",I});_e(this,Lt,async N=>{ce(this,we).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",N),this.state="connected",this.onReconnectSuccess(N)});_e(this,Ft,async N=>{ce(this,we).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",N),this.onReconnectStop(N)});_e(this,Ct,(N,I={})=>{try{const{time:D,event:f,data:k={},data_original:i={},data_remote:c,...$}=I,C=E(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let M={};const J=(ye={})=>{const Q=JSON.parse(JSON.stringify(ye)),ae=Object.keys(Q);for(const he of ae)(he.includes("sdp")||he.includes("Sdp"))&&(Q[he]="");return Q};let Z="res ↓";switch(N){case"res":Z="res ↓",M=J(k);break;case"req":Z="req ↑",M=J(i);break}let z="#quickvo.logs";ignoreEvent.includes(f)&&(z="#quickvo.ignoreEvents");const X={"#action":Z,timeStr:C,event:f,data:M,time:D,...$},re=localStorage.getItem(z)||JSON.stringify([]),oe=JSON.parse(re);let ne=f==="heartbeat"||f==="heartbeatEx";const de=[X];for(const ye of oe){const{event:Q}=ye;if(Q==="heartbeat"||Q==="heartbeatEx"){if(ne)continue;ne=!0}if(de.length===200)break;de.push(ye)}localStorage.setItem(z,JSON.stringify(de))}catch(D){ce(this,we).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});_e(this,jt,(N,{resolve:I,reject:D})=>{const{sn:f=""}=N,k=()=>{const c=ce(this,Ze)[f];clearTimeout(c.destructionTimer),delete ce(this,Ze)[f]},i=window.setTimeout(()=>{const c=ce(this,Ze)[f];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",c.message),k(),D("event is timeout")},ce(this,we).timeout);ce(this,Ze)[f]={message:N,resolve:I,reject:D,destruction:k,destructionTimer:i}});_e(this,zt,N=>ce(this,Ze)[N]);_e(this,Ht,async N=>{const I=new Uint8Array(N),D=com.quick.voice.proto.CommonRsp.decode(I),{sn:f,event:k}=D,i=onMessageFormat(D);if(ce(this,we).debug&&!ignoreEvent.includes(k)&&(ce(this,Ct).call(this,"res",i),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i)),notifyName_keys.includes(k))return this.emitNotify(k,P$1(i,["code","data","desc"]));const $=ce(this,zt).call(this,f);if($){const{resolve:C=J=>{},destruction:M=()=>{}}=$;C(P$1(i,["code","data","desc"])),M()}});ie(this,"clearEvents",(N=[])=>{const I=Object.keys(ce(this,Ze));N.length===0&&(N=I);for(const D of I){if(!N.includes(D))continue;const f=ce(this,Ze)[D];if(f){const{destruction:k}=f;k()}}});ie(this,"connect",async(N="")=>new Promise(async(I,D)=>{try{N&&Be(this,Me,N),ce(this,Ee)&&(await ce(this,Ee).close(),this.state="closed");const f=`${ce(this,we).url}?s=${ce(this,Me)}&t=${Date.now()}`,k=new Date().getTime();if(Be(this,Ee,new S({...ce(this,we),url:f,binaryType:"arraybuffer",onMessage:ce(this,Ht),checkReconnect:ce(this,Pt),getHeartbeatMsg:()=>"",onReconnectSuccess:ce(this,Lt),onReconnectStop:ce(this,Ft),timeout:10*1e3})),this.state="connecting",await ce(this,Ee).connect(),this.state="connected",ce(this,we).debug){const c=new Date().getTime()-k;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${c}ms-广播事件`,ce(this,Ge))}I(ce(this,Ee))}catch(f){D(f)}}));ie(this,"close",async()=>{var I;ce(this,we).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const N=Object.keys(ce(this,Ze));for(const D of N){const{destructionTimer:f}=ce(this,Ze)[D];clearTimeout(f)}Be(this,Ze,{}),await((I=ce(this,Ee))==null?void 0:I.close()),this.state="closed"});ie(this,"sendMessage",(N,I=!0)=>new Promise(async(D,f)=>{var M;await this.sendMessageBefore();const{event:k,...i}=N,c=Date.now(),$=sendMessageFormat({event:k,sn:+`${c}${v$1(1e3,9999)}`,time:c,valid:ce(this,we).timeout,version:1,compress:!1,...i});ce(this,we).debug&&!ignoreEvent.includes(k)&&(ce(this,Ct).call(this,"req",$),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",$)),I&&ce(this,jt).call(this,$,{resolve:D,reject:f});const C=com.quick.voice.proto.CommonReq.encode($).finish();(M=ce(this,Ee))==null||M.sendMessage(C)}));ie(this,"emitNotify",async(N,I)=>{const D=ce(this,Ge)[N]||[];for(const f of D){const{callback:k=async()=>{}}=f;await k(I)}});ie(this,"addNotify",(N,I=!1)=>{const{event:D,sn:f=xt(32)}=N;ce(this,Ge)[D]||(ce(this,Ge)[D]=[]);const k=ce(this,Ge)[D],i=k.findIndex(c=>c.sn===f);return i!==-1&&k.splice(i,1),I?k.unshift(N):k.push(N),f});ie(this,"removeNotify",(N=[])=>{if(N.length===0)Be(this,Ge,{});else{const I=Object.keys(ce(this,Ge));for(const D of I)ce(this,Ge)[D]=ce(this,Ge)[D].filter(f=>!N.includes(f.sn||""))}ce(this,we).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",ce(this,Ge))});Be(this,we,{...ce(this,we),...N})}}Ee=new WeakMap,we=new WeakMap,Me=new WeakMap,Ze=new WeakMap,Ge=new WeakMap,Pt=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,Ct=new WeakMap,jt=new WeakMap,zt=new WeakMap,Ht=new WeakMap;const createMutedAudioStream=O=>{const N=O.createOscillator();N.type="sine",N.frequency.setValueAtTime(0,O.currentTime);const I=O.createGain();I.gain.value=0,N.connect(I),I.connect(O.destination),N.start();const D=O.createMediaStreamDestination();return I.disconnect(),N.connect(D),D.stream},createFakeVideoStream=(O=10,N=10,I=30)=>{const D=document.createElement("canvas"),f=D.getContext("2d");D.width=O,D.height=N;let k=0;return setInterval(()=>{f.clearRect(0,0,D.width,D.height);const $=f.createLinearGradient(0,0,D.width,D.height);$.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),$.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),f.fillStyle=$,f.fillRect(0,0,D.width,D.height),k=(k+1)%360},100),D.captureStream(I)};class NetworkQualityTester{constructor(N=[]){ie(this,"targetUrls",[]);ie(this,"results",[]);N.length===0&&N.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=N,this.results=[]}async testAll(){const N=this.targetUrls.map(I=>this.testUrl(I));return await Promise.all(N),this.analyzeResults()}async testUrl(N){const I=performance.now();let D=0,f=!1;try{await fetch(N,{method:"HEAD",cache:"no-store"});const k=performance.now()-I,i=performance.now(),$=await(await fetch(N,{cache:"no-store"})).blob(),C=performance.now()-i;D=$.size,f=!0,this.results.push({url:N,success:f,headTime:k,getTime:C,size:D,downloadSpeed:D>0?(D/1024/(C/1e3)).toFixed(2):0,totalTime:performance.now()-I})}catch(k){this.results.push({url:N,success:!1,error:k.message,totalTime:performance.now()-I})}}analyzeResults(){const N=this.results.filter(k=>k.success);if(N.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const I=N.reduce((k,i)=>k+i.size,0),D=N.reduce((k,i)=>k+i.totalTime,0),f=N.reduce((k,i)=>k+parseFloat(i.downloadSpeed),0)/N.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:N.length,averageDownloadSpeed:`${f.toFixed(2)} KB/s`,averageResponseTime:`${(D/N.length).toFixed(2)}ms`,totalDataTransferred:`${(I/1024).toFixed(2)} KB`,detailedResults:this.results}}}var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,function(O){(function(N){var I="undefined",D=I!==typeof Buffer&&Buffer,f=I!==typeof Uint8Array&&Uint8Array,k=I!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],c=Array.isArray||he,$=4294967296,C=16777216,M;J("Uint64BE",!0,!0),J("Int64BE",!0,!1),J("Uint64LE",!1,!0),J("Int64LE",!1,!1);function J(se,fe,me){var ee=fe?0:4,le=fe?4:0,ve=fe?0:3,be=fe?1:2,ge=fe?2:1,$e=fe?3:0,Ne=fe?de:Q,Le=fe?ye:ae,Fe=Re.prototype,Ye="is"+se,ft="_"+Ye;return Fe.buffer=void 0,Fe.offset=0,Fe[ft]=!0,Fe.toNumber=Xe,Fe.toString=at,Fe.toJSON=Xe,Fe.toArray=Z,D&&(Fe.toBuffer=z),f&&(Fe.toArrayBuffer=X),Re[Ye]=xe,N[se]=Re,Re;function Re(Se,ke,Te,Oe){return this instanceof Re?ot(this,Se,ke,Te,Oe):new Re(Se,ke,Te,Oe)}function xe(Se){return!!(Se&&Se[ft])}function ot(Se,ke,Te,Oe,Ce){if(f&&k&&(ke instanceof k&&(ke=new f(ke)),Oe instanceof k&&(Oe=new f(Oe))),!ke&&!Te&&!Oe&&!M){Se.buffer=ne(i,0);return}if(!re(ke,Te)){var je=M||Array;Ce=Te,Oe=ke,Te=0,ke=M===D?D.alloc(8):new je(8)}Se.buffer=ke,Se.offset=Te|=0,I!==typeof Oe&&(typeof Oe=="string"?Pe(ke,Te,Oe,Ce||10):re(Oe,Ce)?oe(ke,Te,Oe,Ce):typeof Ce=="number"?(Qe(ke,Te+ee,Oe),Qe(ke,Te+le,Ce)):Oe>0?Ne(ke,Te,Oe):Oe<0?Le(ke,Te,Oe):oe(ke,Te,i,0))}function Pe(Se,ke,Te,Oe){var Ce=0,je=Te.length,Ve=0,Je=0;Te[0]==="-"&&Ce++;for(var ct=Ce;Ce<je;){var mt=parseInt(Te[Ce++],Oe);if(!(mt>=0))break;Je=Je*Oe+mt,Ve=Ve*Oe+Math.floor(Je/$),Je%=$}ct&&(Ve=~Ve,Je?Je=$-Je:Ve++),Qe(Se,ke+ee,Ve),Qe(Se,ke+le,Je)}function Xe(){var Se=this.buffer,ke=this.offset,Te=He(Se,ke+ee),Oe=He(Se,ke+le);return me||(Te|=0),Te?Te*$+Oe:Oe}function at(Se){var ke=this.buffer,Te=this.offset,Oe=He(ke,Te+ee),Ce=He(ke,Te+le),je="",Ve=!me&&Oe&2147483648;for(Ve&&(Oe=~Oe,Ce=$-Ce),Se=Se||10;;){var Je=Oe%Se*$+Ce;if(Oe=Math.floor(Oe/Se),Ce=Math.floor(Je/Se),je=(Je%Se).toString(Se)+je,!Oe&&!Ce)break}return Ve&&(je="-"+je),je}function Qe(Se,ke,Te){Se[ke+$e]=Te&255,Te=Te>>8,Se[ke+ge]=Te&255,Te=Te>>8,Se[ke+be]=Te&255,Te=Te>>8,Se[ke+ve]=Te&255}function He(Se,ke){return Se[ke+ve]*C+(Se[ke+be]<<16)+(Se[ke+ge]<<8)+Se[ke+$e]}}function Z(se){var fe=this.buffer,me=this.offset;return M=null,se!==!1&&c(fe)?fe.length===8?fe:fe.slice(me,me+8):ne(fe,me)}function z(se){var fe=this.buffer,me=this.offset;return M=D,se!==!1&&D.isBuffer(fe)?fe.length===8?fe:fe.slice(me,me+8):D.from(X.call(this,se))}function X(se){var fe=this.buffer,me=this.offset,ee=fe.buffer;if(M=f,se!==!1&&!fe.offset&&ee instanceof k)return ee.byteLength===8?ee:ee.slice(me,me+8);var le=new f(8);return oe(le,0,fe,me),le.buffer}function re(se,fe){var me=se&&se.length;return fe|=0,me&&fe+8<=me&&typeof se[fe]!="string"}function oe(se,fe,me,ee){fe|=0,ee|=0;for(var le=0;le<8;le++)se[fe++]=me[ee++]&255}function ne(se,fe){return Array.prototype.slice.call(se,fe,fe+8)}function de(se,fe,me){for(var ee=fe+8;ee>fe;)se[--ee]=me&255,me/=256}function ye(se,fe,me){var ee=fe+8;for(me++;ee>fe;)se[--ee]=-me&255^255,me/=256}function Q(se,fe,me){for(var ee=fe+8;fe<ee;)se[fe++]=me&255,me/=256}function ae(se,fe,me){var ee=fe+8;for(me++;fe<ee;)se[fe++]=-me&255^255,me/=256}function he(se){return!!se&&Object.prototype.toString.call(se)=="[object Array]"}})(typeof O.nodeName!="string"?O:int64Buffer||{})}(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
4
- between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var O=requireTools(),N=requireTools(),I=requireEbmlID(),D=function(){function f(){this._schema=I.byEbmlID,this._buffers=[],this._stack=[]}return f.prototype.encode=function(k){var i=this;return O.concat(k.reduce(function(c,$){return c.concat(i.encodeChunk($))},[])).buffer},f.prototype.encodeChunk=function(k){return k.type==="m"?k.isEnd?this.endTag(k):this.startTag(k):(k.data=N.Buffer.from(k.data),this.writeTag(k)),this.flush()},f.prototype.flush=function(){var k=this._buffers;return this._buffers=[],k},f.prototype.getSchemaInfo=function(k){for(var i=Object.keys(this._schema).map(Number),c=0;c<i.length;c++){var $=i[c];if(this._schema[$].name===k)return new N.Buffer($.toString(16),"hex")}return null},f.prototype.writeTag=function(k){var i=k.name,c=this.getSchemaInfo(i),$=k.data;if(c==null)throw new Error("No schema entry found for "+i);var C=O.encodeTag(c,$);if(this._stack.length>0){var M=this._stack[this._stack.length-1];M.children.push({tagId:c,elm:k,children:[],data:C});return}this._buffers=this._buffers.concat(C)},f.prototype.startTag=function(k){var i=k.name,c=this.getSchemaInfo(i);if(c==null)throw new Error("No schema entry found for "+i);if(k.unknownSize){var $=O.encodeTag(c,new N.Buffer(0),k.unknownSize);this._buffers=this._buffers.concat($);return}var C={tagId:c,elm:k,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(C),this._stack.push(C)},f.prototype.endTag=function(k){k.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==k.name)throw new Error("EBML structure is broken");var c=i.children.reduce(function(C,M){if(M.data===null)throw new Error("EBML structure is broken");return C.concat(M.data)},[]),$=O.concat(c);i.elm.type==="m"?i.data=O.encodeTag(i.tagId,$,i.elm.unknownSize):i.data=O.encodeTag(i.tagId,$),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},f}();return EBMLEncoder.default=D,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=c,base64Js.toByteArray=C,base64Js.fromByteArray=Z;for(var O=[],N=[],I=typeof Uint8Array<"u"?Uint8Array:Array,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,k=D.length;f<k;++f)O[f]=D[f],N[D.charCodeAt(f)]=f;N[45]=62,N[95]=63;function i(z){var X=z.length;if(X%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var re=z.indexOf("=");re===-1&&(re=X);var oe=re===X?0:4-re%4;return[re,oe]}function c(z){var X=i(z),re=X[0],oe=X[1];return(re+oe)*3/4-oe}function $(z,X,re){return(X+re)*3/4-re}function C(z){var X,re=i(z),oe=re[0],ne=re[1],de=new I($(z,oe,ne)),ye=0,Q=ne>0?oe-4:oe,ae;for(ae=0;ae<Q;ae+=4)X=N[z.charCodeAt(ae)]<<18|N[z.charCodeAt(ae+1)]<<12|N[z.charCodeAt(ae+2)]<<6|N[z.charCodeAt(ae+3)],de[ye++]=X>>16&255,de[ye++]=X>>8&255,de[ye++]=X&255;return ne===2&&(X=N[z.charCodeAt(ae)]<<2|N[z.charCodeAt(ae+1)]>>4,de[ye++]=X&255),ne===1&&(X=N[z.charCodeAt(ae)]<<10|N[z.charCodeAt(ae+1)]<<4|N[z.charCodeAt(ae+2)]>>2,de[ye++]=X>>8&255,de[ye++]=X&255),de}function M(z){return O[z>>18&63]+O[z>>12&63]+O[z>>6&63]+O[z&63]}function J(z,X,re){for(var oe,ne=[],de=X;de<re;de+=3)oe=(z[de]<<16&16711680)+(z[de+1]<<8&65280)+(z[de+2]&255),ne.push(M(oe));return ne.join("")}function Z(z){for(var X,re=z.length,oe=re%3,ne=[],de=16383,ye=0,Q=re-oe;ye<Q;ye+=de)ne.push(J(z,ye,ye+de>Q?Q:ye+de));return oe===1?(X=z[re-1],ne.push(O[X>>2]+O[X<<4&63]+"==")):oe===2&&(X=(z[re-2]<<8)+z[re-1],ne.push(O[X>>10]+O[X>>4&63]+O[X<<2&63]+"=")),ne.join("")}return base64Js}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(O,N,I,D,f){var k,i,c=f*8-D-1,$=(1<<c)-1,C=$>>1,M=-7,J=I?f-1:0,Z=I?-1:1,z=O[N+J];for(J+=Z,k=z&(1<<-M)-1,z>>=-M,M+=c;M>0;k=k*256+O[N+J],J+=Z,M-=8);for(i=k&(1<<-M)-1,k>>=-M,M+=D;M>0;i=i*256+O[N+J],J+=Z,M-=8);if(k===0)k=1-C;else{if(k===$)return i?NaN:(z?-1:1)*(1/0);i=i+Math.pow(2,D),k=k-C}return(z?-1:1)*i*Math.pow(2,k-D)},ieee754.write=function(O,N,I,D,f,k){var i,c,$,C=k*8-f-1,M=(1<<C)-1,J=M>>1,Z=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=D?0:k-1,X=D?1:-1,re=N<0||N===0&&1/N<0?1:0;for(N=Math.abs(N),isNaN(N)||N===1/0?(c=isNaN(N)?1:0,i=M):(i=Math.floor(Math.log(N)/Math.LN2),N*($=Math.pow(2,-i))<1&&(i--,$*=2),i+J>=1?N+=Z/$:N+=Z*Math.pow(2,1-J),N*$>=2&&(i++,$/=2),i+J>=M?(c=0,i=M):i+J>=1?(c=(N*$-1)*Math.pow(2,f),i=i+J):(c=N*Math.pow(2,J-1)*Math.pow(2,f),i=0));f>=8;O[I+z]=c&255,z+=X,c/=256,f-=8);for(i=i<<f|c,C+=f;C>0;O[I+z]=i&255,z+=X,i/=256,C-=8);O[I+z-X]|=re*128}),ieee754}/*!
3
+ `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var O=requireParser(),N=requireWriter$1(),$=requireGrammar();return lib$1.grammar=$,lib$1.write=N,lib$1.parse=O.parse,lib$1.parseParams=O.parseParams,lib$1.parseFmtpConfig=O.parseFmtpConfig,lib$1.parsePayloads=O.parsePayloads,lib$1.parseRemoteCandidates=O.parseRemoteCandidates,lib$1.parseImageAttributes=O.parseImageAttributes,lib$1.parseSimulcastStreamList=O.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(N){ne(this,"kind","video");ne(this,"stream",new MediaStream);ne(this,"stop",()=>{const N=this.stream.getTracks();for(const $ of N)$.stop(),this.stream.removeTrack($)});ne(this,"replaceStream",N=>{const $=this.stream,D=$.getTracks();for(const k of D)$.removeTrack(k);const[b]=N.getVideoTracks();b&&$.addTrack(b)});ne(this,"getStream",()=>this.stream);ne(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(N)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var B=Object.defineProperty,T=O=>{throw TypeError(O)},R=(O,N,$)=>N in O?B(O,N,{enumerable:!0,configurable:!0,writable:!0,value:$}):O[N]=$,o$1=(O,N,$)=>R(O,typeof N!="symbol"?N+"":N,$),y$1=(O,N,$)=>N.has(O)||T("Cannot "+$),t=(O,N,$)=>(y$1(O,N,"read from private field"),$?$.call(O):N.get(O)),r=(O,N,$)=>N.has(O)?T("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(O):N.set(O,$),a$1=(O,N,$,D)=>(y$1(O,N,"write to private field"),N.set(O,$),$),n$1,h,l$1,u,p$1,f,d$1,w,x,g$1,m$1;class I{constructor(N){r(this,n$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),o$1(this,"ws"),o$1(this,"checkReconnect",async $=>(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,n$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,h)}`),await new Promise(D=>setTimeout(()=>D(!0),t(this,n$1).reconnectIntervalTime)),!0)),o$1(this,"onReconnectSuccess",async $=>{}),o$1(this,"onReconnectStop",async $=>{}),o$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),o$1(this,"onMessage",$=>{}),r(this,h,-1),r(this,l$1,-1),r(this,u,0),r(this,p$1,0),r(this,f,0),r(this,d$1,!1),o$1(this,"setOptions",$=>{a$1(this,n$1,{...t(this,n$1),...$})}),o$1(this,"connect",()=>new Promise(async($,D)=>{this.ws=new WebSocket(t(this,n$1).url),this.ws.binaryType=t(this,n$1).binaryType,this.ws.addEventListener("message",t(this,x)),this.ws.addEventListener("open",b=>{clearTimeout(t(this,u)),a$1(this,h,t(this,n$1).reconnectCount),a$1(this,l$1,-1),t(this,g$1).call(this),t(this,n$1).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),$(b)}),this.ws.addEventListener("error",b=>{clearTimeout(t(this,u)),t(this,n$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",b),D(b)}),this.ws.addEventListener("close",b=>{if(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${b.code}, permanentClosed is ${t(this,d$1)}.`,b),t(this,m$1).call(this),!t(this,d$1))return this.reconnect(b);this.ws=void 0}),a$1(this,u,window.setTimeout(()=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",this),D("connect is timeout.")},t(this,n$1).timeout))})),o$1(this,"reconnect",async $=>new Promise(async D=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const b=k=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${k}`),this.onReconnectStop({msg:k}),D(k)};if(t(this,w).call(this)===!1)return b("stop reconnect. exceed maxReconnectionTime.");if(t(this,h)!==-1&&t(this,h)===0)return b("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect($))return b("stop reconnect. checkReconnect is false.");a$1(this,h,Math.max(-1,t(this,h)-1)),await this.connect().then(()=>this.onReconnectSuccess(this.ws)),D(!0)})),o$1(this,"sendMessage",async $=>{var D;(!this.ws||this.ws.readyState!==1)&&(t(this,n$1).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,n$1).autoConnect&&(t(this,n$1).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$1(this,"close",async($=1e3,D="correctly close.")=>{var b;this.ws&&(a$1(this,d$1,!0),t(this,m$1).call(this),(b=this.ws)==null||b.close($,D))}),r(this,w,()=>{const $=Date.now();return t(this,l$1)===-1&&a$1(this,l$1,$+t(this,n$1).reconnectTime),!($>t(this,l$1))}),r(this,x,$=>{const{data:D}=$;this.onMessage(D)}),r(this,g$1,()=>{a$1(this,f,window.setInterval(()=>{const $=this.getHeartbeatMsg();$&&this.sendMessage($)},t(this,n$1).heartbeatIntervalTime))}),r(this,m$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,f))}),a$1(this,n$1,{...t(this,n$1),...N}),a$1(this,h,t(this,n$1).reconnectCount)}}n$1=new WeakMap,h=new WeakMap,l$1=new WeakMap,u=new WeakMap,p$1=new WeakMap,f=new WeakMap,d$1=new WeakMap,w=new WeakMap,x=new WeakMap,g$1=new WeakMap,m$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=O;function O(N,$){for(var D=new Array(arguments.length-1),b=0,k=2,i=!0;k<arguments.length;)D[b++]=arguments[k++];return new Promise(function(S,C){D[b]=function(Z){if(i)if(i=!1,Z)C(Z);else{for(var J=new Array(arguments.length-1),z=0;z<J.length;)J[z++]=arguments[z];S.apply(null,J)}};try{N.apply($||null,D)}catch(M){i&&(i=!1,C(M))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(O){var N=O;N.length=function(c){var S=c.length;if(!S)return 0;for(var C=0;--S%4>1&&c.charAt(S)==="=";)++C;return Math.ceil(c.length*3)/4-C};for(var $=new Array(64),D=new Array(123),b=0;b<64;)D[$[b]=b<26?b+65:b<52?b+71:b<62?b-4:b-59|43]=b++;N.encode=function(c,S,C){for(var M=null,Z=[],J=0,z=0,Y;S<C;){var re=c[S++];switch(z){case 0:Z[J++]=$[re>>2],Y=(re&3)<<4,z=1;break;case 1:Z[J++]=$[Y|re>>4],Y=(re&15)<<2,z=2;break;case 2:Z[J++]=$[Y|re>>6],Z[J++]=$[re&63],z=0;break}J>8191&&((M||(M=[])).push(String.fromCharCode.apply(String,Z)),J=0)}return z&&(Z[J++]=$[Y],Z[J++]=61,z===1&&(Z[J++]=61)),M?(J&&M.push(String.fromCharCode.apply(String,Z.slice(0,J))),M.join("")):String.fromCharCode.apply(String,Z.slice(0,J))};var k="invalid encoding";N.decode=function(c,S,C){for(var M=C,Z=0,J,z=0;z<c.length;){var Y=c.charCodeAt(z++);if(Y===61&&Z>1)break;if((Y=D[Y])===void 0)throw Error(k);switch(Z){case 0:J=Y,Z=1;break;case 1:S[C++]=J<<2|(Y&48)>>4,J=Y,Z=2;break;case 2:S[C++]=(J&15)<<4|(Y&60)>>2,J=Y,Z=3;break;case 3:S[C++]=(J&3)<<6|Y,Z=0;break}}if(Z===1)throw Error(k);return C-M},N.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=O;function O(){this._listeners={}}return O.prototype.on=function($,D,b){return(this._listeners[$]||(this._listeners[$]=[])).push({fn:D,ctx:b||this}),this},O.prototype.off=function($,D){if($===void 0)this._listeners={};else if(D===void 0)this._listeners[$]=[];else for(var b=this._listeners[$],k=0;k<b.length;)b[k].fn===D?b.splice(k,1):++k;return this},O.prototype.emit=function($){var D=this._listeners[$];if(D){for(var b=[],k=1;k<arguments.length;)b.push(arguments[k++]);for(k=0;k<D.length;)D[k].fn.apply(D[k++].ctx,b)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=O(O);function O(k){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),c=new Uint8Array(i.buffer),S=c[3]===128;function C(z,Y,re){i[0]=z,Y[re]=c[0],Y[re+1]=c[1],Y[re+2]=c[2],Y[re+3]=c[3]}function M(z,Y,re){i[0]=z,Y[re]=c[3],Y[re+1]=c[2],Y[re+2]=c[1],Y[re+3]=c[0]}k.writeFloatLE=S?C:M,k.writeFloatBE=S?M:C;function Z(z,Y){return c[0]=z[Y],c[1]=z[Y+1],c[2]=z[Y+2],c[3]=z[Y+3],i[0]}function J(z,Y){return c[3]=z[Y],c[2]=z[Y+1],c[1]=z[Y+2],c[0]=z[Y+3],i[0]}k.readFloatLE=S?Z:J,k.readFloatBE=S?J:Z}():function(){function i(S,C,M,Z){var J=C<0?1:0;if(J&&(C=-C),C===0)S(1/C>0?0:2147483648,M,Z);else if(isNaN(C))S(2143289344,M,Z);else if(C>34028234663852886e22)S((J<<31|2139095040)>>>0,M,Z);else if(C<11754943508222875e-54)S((J<<31|Math.round(C/1401298464324817e-60))>>>0,M,Z);else{var z=Math.floor(Math.log(C)/Math.LN2),Y=Math.round(C*Math.pow(2,-z)*8388608)&8388607;S((J<<31|z+127<<23|Y)>>>0,M,Z)}}k.writeFloatLE=i.bind(null,N),k.writeFloatBE=i.bind(null,$);function c(S,C,M){var Z=S(C,M),J=(Z>>31)*2+1,z=Z>>>23&255,Y=Z&8388607;return z===255?Y?NaN:J*(1/0):z===0?J*1401298464324817e-60*Y:J*Math.pow(2,z-150)*(Y+8388608)}k.readFloatLE=c.bind(null,D),k.readFloatBE=c.bind(null,b)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),c=new Uint8Array(i.buffer),S=c[7]===128;function C(z,Y,re){i[0]=z,Y[re]=c[0],Y[re+1]=c[1],Y[re+2]=c[2],Y[re+3]=c[3],Y[re+4]=c[4],Y[re+5]=c[5],Y[re+6]=c[6],Y[re+7]=c[7]}function M(z,Y,re){i[0]=z,Y[re]=c[7],Y[re+1]=c[6],Y[re+2]=c[5],Y[re+3]=c[4],Y[re+4]=c[3],Y[re+5]=c[2],Y[re+6]=c[1],Y[re+7]=c[0]}k.writeDoubleLE=S?C:M,k.writeDoubleBE=S?M:C;function Z(z,Y){return c[0]=z[Y],c[1]=z[Y+1],c[2]=z[Y+2],c[3]=z[Y+3],c[4]=z[Y+4],c[5]=z[Y+5],c[6]=z[Y+6],c[7]=z[Y+7],i[0]}function J(z,Y){return c[7]=z[Y],c[6]=z[Y+1],c[5]=z[Y+2],c[4]=z[Y+3],c[3]=z[Y+4],c[2]=z[Y+5],c[1]=z[Y+6],c[0]=z[Y+7],i[0]}k.readDoubleLE=S?Z:J,k.readDoubleBE=S?J:Z}():function(){function i(S,C,M,Z,J,z){var Y=Z<0?1:0;if(Y&&(Z=-Z),Z===0)S(0,J,z+C),S(1/Z>0?0:2147483648,J,z+M);else if(isNaN(Z))S(0,J,z+C),S(2146959360,J,z+M);else if(Z>17976931348623157e292)S(0,J,z+C),S((Y<<31|2146435072)>>>0,J,z+M);else{var re;if(Z<22250738585072014e-324)re=Z/5e-324,S(re>>>0,J,z+C),S((Y<<31|re/4294967296)>>>0,J,z+M);else{var oe=Math.floor(Math.log(Z)/Math.LN2);oe===1024&&(oe=1023),re=Z*Math.pow(2,-oe),S(re*4503599627370496>>>0,J,z+C),S((Y<<31|oe+1023<<20|re*1048576&1048575)>>>0,J,z+M)}}}k.writeDoubleLE=i.bind(null,N,0,4),k.writeDoubleBE=i.bind(null,$,4,0);function c(S,C,M,Z,J){var z=S(Z,J+C),Y=S(Z,J+M),re=(Y>>31)*2+1,oe=Y>>>20&2047,ie=4294967296*(Y&1048575)+z;return oe===2047?ie?NaN:re*(1/0):oe===0?re*5e-324*ie:re*Math.pow(2,oe-1075)*(ie+4503599627370496)}k.readDoubleLE=c.bind(null,D,0,4),k.readDoubleBE=c.bind(null,b,4,0)}(),k}function N(k,i,c){i[c]=k&255,i[c+1]=k>>>8&255,i[c+2]=k>>>16&255,i[c+3]=k>>>24}function $(k,i,c){i[c]=k>>>24,i[c+1]=k>>>16&255,i[c+2]=k>>>8&255,i[c+3]=k&255}function D(k,i){return(k[i]|k[i+1]<<8|k[i+2]<<16|k[i+3]<<24)>>>0}function b(k,i){return(k[i]<<24|k[i+1]<<16|k[i+2]<<8|k[i+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(O){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(O){var N=O;N.length=function(D){for(var b=0,k=0,i=0;i<D.length;++i)k=D.charCodeAt(i),k<128?b+=1:k<2048?b+=2:(k&64512)===55296&&(D.charCodeAt(i+1)&64512)===56320?(++i,b+=4):b+=3;return b},N.read=function(D,b,k){var i=k-b;if(i<1)return"";for(var c=null,S=[],C=0,M;b<k;)M=D[b++],M<128?S[C++]=M:M>191&&M<224?S[C++]=(M&31)<<6|D[b++]&63:M>239&&M<365?(M=((M&7)<<18|(D[b++]&63)<<12|(D[b++]&63)<<6|D[b++]&63)-65536,S[C++]=55296+(M>>10),S[C++]=56320+(M&1023)):S[C++]=(M&15)<<12|(D[b++]&63)<<6|D[b++]&63,C>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,S)),C=0);return c?(C&&c.push(String.fromCharCode.apply(String,S.slice(0,C))),c.join("")):String.fromCharCode.apply(String,S.slice(0,C))},N.write=function(D,b,k){for(var i=k,c,S,C=0;C<D.length;++C)c=D.charCodeAt(C),c<128?b[k++]=c:c<2048?(b[k++]=c>>6|192,b[k++]=c&63|128):(c&64512)===55296&&((S=D.charCodeAt(C+1))&64512)===56320?(c=65536+((c&1023)<<10)+(S&1023),++C,b[k++]=c>>18|240,b[k++]=c>>12&63|128,b[k++]=c>>6&63|128,b[k++]=c&63|128):(b[k++]=c>>12|224,b[k++]=c>>6&63|128,b[k++]=c&63|128);return k-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=O;function O(N,$,D){var b=D||8192,k=b>>>1,i=null,c=b;return function(C){if(C<1||C>k)return N(C);c+C>b&&(i=N(b),c=0);var M=$.call(i,c,c+=C);return c&7&&(c=(c|7)+1),M}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=N;var O=requireMinimal$1();function N(k,i){this.lo=k>>>0,this.hi=i>>>0}var $=N.zero=new N(0,0);$.toNumber=function(){return 0},$.zzEncode=$.zzDecode=function(){return this},$.length=function(){return 1};var D=N.zeroHash="\0\0\0\0\0\0\0\0";N.fromNumber=function(i){if(i===0)return $;var c=i<0;c&&(i=-i);var S=i>>>0,C=(i-S)/4294967296>>>0;return c&&(C=~C>>>0,S=~S>>>0,++S>4294967295&&(S=0,++C>4294967295&&(C=0))),new N(S,C)},N.from=function(i){if(typeof i=="number")return N.fromNumber(i);if(O.isString(i))if(O.Long)i=O.Long.fromString(i);else return N.fromNumber(parseInt(i,10));return i.low||i.high?new N(i.low>>>0,i.high>>>0):$},N.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var c=~this.lo+1>>>0,S=~this.hi>>>0;return c||(S=S+1>>>0),-(c+S*4294967296)}return this.lo+this.hi*4294967296},N.prototype.toLong=function(i){return O.Long?new O.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var b=String.prototype.charCodeAt;return N.fromHash=function(i){return i===D?$:new N((b.call(i,0)|b.call(i,1)<<8|b.call(i,2)<<16|b.call(i,3)<<24)>>>0,(b.call(i,4)|b.call(i,5)<<8|b.call(i,6)<<16|b.call(i,7)<<24)>>>0)},N.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)},N.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},N.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},N.prototype.length=function(){var i=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,S=this.hi>>>24;return S===0?c===0?i<16384?i<128?1:2:i<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:S<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(O){var N=O;N.asPromise=requireAspromise(),N.base64=requireBase64(),N.EventEmitter=requireEventemitter(),N.float=requireFloat(),N.inquire=requireInquire(),N.utf8=requireUtf8(),N.pool=requirePool(),N.LongBits=requireLongbits(),N.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),N.global=N.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,N.emptyArray=Object.freeze?Object.freeze([]):[],N.emptyObject=Object.freeze?Object.freeze({}):{},N.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k},N.isString=function(k){return typeof k=="string"||k instanceof String},N.isObject=function(k){return k&&typeof k=="object"},N.isset=N.isSet=function(k,i){var c=k[i];return c!=null&&k.hasOwnProperty(i)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},N.Buffer=function(){try{var b=N.inquire("buffer").Buffer;return b.prototype.utf8Write?b:null}catch{return null}}(),N._Buffer_from=null,N._Buffer_allocUnsafe=null,N.newBuffer=function(k){return typeof k=="number"?N.Buffer?N._Buffer_allocUnsafe(k):new N.Array(k):N.Buffer?N._Buffer_from(k):typeof Uint8Array>"u"?k:new Uint8Array(k)},N.Array=typeof Uint8Array<"u"?Uint8Array:Array,N.Long=N.global.dcodeIO&&N.global.dcodeIO.Long||N.global.Long||N.inquire("long"),N.key2Re=/^true|false|0|1$/,N.key32Re=/^-?(?:0|[1-9][0-9]*)$/,N.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,N.longToHash=function(k){return k?N.LongBits.from(k).toHash():N.LongBits.zeroHash},N.longFromHash=function(k,i){var c=N.LongBits.fromHash(k);return N.Long?N.Long.fromBits(c.lo,c.hi,i):c.toNumber(!!i)};function $(b,k,i){for(var c=Object.keys(k),S=0;S<c.length;++S)(b[c[S]]===void 0||!i)&&(b[c[S]]=k[c[S]]);return b}N.merge=$,N.lcFirst=function(k){return k.charAt(0).toLowerCase()+k.substring(1)};function D(b){function k(i,c){if(!(this instanceof k))return new k(i,c);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,k):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&$(this,c)}return k.prototype=Object.create(Error.prototype,{constructor:{value:k,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return b},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),k}N.newError=D,N.ProtocolError=D("ProtocolError"),N.oneOfGetter=function(k){for(var i={},c=0;c<k.length;++c)i[k[c]]=1;return function(){for(var S=Object.keys(this),C=S.length-1;C>-1;--C)if(i[S[C]]===1&&this[S[C]]!==void 0&&this[S[C]]!==null)return S[C]}},N.oneOfSetter=function(k){return function(i){for(var c=0;c<k.length;++c)k[c]!==i&&delete this[k[c]]}},N.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},N._configure=function(){var b=N.Buffer;if(!b){N._Buffer_from=N._Buffer_allocUnsafe=null;return}N._Buffer_from=b.from!==Uint8Array.from&&b.from||function(i,c){return new b(i,c)},N._Buffer_allocUnsafe=b.allocUnsafe||function(i){return new b(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=S;var O=requireMinimal$1(),N,$=O.LongBits,D=O.base64,b=O.utf8;function k(oe,ie,de){this.fn=oe,this.len=ie,this.next=void 0,this.val=de}function i(){}function c(oe){this.head=oe.head,this.tail=oe.tail,this.len=oe.len,this.next=oe.states}function S(){this.len=0,this.head=new k(i,0,0),this.tail=this.head,this.states=null}var C=function(){return O.Buffer?function(){return(S.create=function(){return new N})()}:function(){return new S}};S.create=C(),S.alloc=function(ie){return new O.Array(ie)},O.Array!==Array&&(S.alloc=O.pool(S.alloc,O.Array.prototype.subarray)),S.prototype._push=function(ie,de,ye){return this.tail=this.tail.next=new k(ie,de,ye),this.len+=de,this};function M(oe,ie,de){ie[de]=oe&255}function Z(oe,ie,de){for(;oe>127;)ie[de++]=oe&127|128,oe>>>=7;ie[de]=oe}function J(oe,ie){this.len=oe,this.next=void 0,this.val=ie}J.prototype=Object.create(k.prototype),J.prototype.fn=Z,S.prototype.uint32=function(ie){return this.len+=(this.tail=this.tail.next=new J((ie=ie>>>0)<128?1:ie<16384?2:ie<2097152?3:ie<268435456?4:5,ie)).len,this},S.prototype.int32=function(ie){return ie<0?this._push(z,10,$.fromNumber(ie)):this.uint32(ie)},S.prototype.sint32=function(ie){return this.uint32((ie<<1^ie>>31)>>>0)};function z(oe,ie,de){for(;oe.hi;)ie[de++]=oe.lo&127|128,oe.lo=(oe.lo>>>7|oe.hi<<25)>>>0,oe.hi>>>=7;for(;oe.lo>127;)ie[de++]=oe.lo&127|128,oe.lo=oe.lo>>>7;ie[de++]=oe.lo}S.prototype.uint64=function(ie){var de=$.from(ie);return this._push(z,de.length(),de)},S.prototype.int64=S.prototype.uint64,S.prototype.sint64=function(ie){var de=$.from(ie).zzEncode();return this._push(z,de.length(),de)},S.prototype.bool=function(ie){return this._push(M,1,ie?1:0)};function Y(oe,ie,de){ie[de]=oe&255,ie[de+1]=oe>>>8&255,ie[de+2]=oe>>>16&255,ie[de+3]=oe>>>24}S.prototype.fixed32=function(ie){return this._push(Y,4,ie>>>0)},S.prototype.sfixed32=S.prototype.fixed32,S.prototype.fixed64=function(ie){var de=$.from(ie);return this._push(Y,4,de.lo)._push(Y,4,de.hi)},S.prototype.sfixed64=S.prototype.fixed64,S.prototype.float=function(ie){return this._push(O.float.writeFloatLE,4,ie)},S.prototype.double=function(ie){return this._push(O.float.writeDoubleLE,8,ie)};var re=O.Array.prototype.set?function(ie,de,ye){de.set(ie,ye)}:function(ie,de,ye){for(var Q=0;Q<ie.length;++Q)de[ye+Q]=ie[Q]};return S.prototype.bytes=function(ie){var de=ie.length>>>0;if(!de)return this._push(M,1,0);if(O.isString(ie)){var ye=S.alloc(de=D.length(ie));D.decode(ie,ye,0),ie=ye}return this.uint32(de)._push(re,de,ie)},S.prototype.string=function(ie){var de=b.length(ie);return de?this.uint32(de)._push(b.write,de,ie):this._push(M,1,0)},S.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new k(i,0,0),this.len=0,this},S.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(i,0,0),this.len=0),this},S.prototype.ldelim=function(){var ie=this.head,de=this.tail,ye=this.len;return this.reset().uint32(ye),ye&&(this.tail.next=ie.next,this.tail=de,this.len+=ye),this},S.prototype.finish=function(){for(var ie=this.head.next,de=this.constructor.alloc(this.len),ye=0;ie;)ie.fn(ie.val,de,ye),ye+=ie.len,ie=ie.next;return de},S._configure=function(oe){N=oe,S.create=C(),N._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=$;var O=requireWriter();($.prototype=Object.create(O.prototype)).constructor=$;var N=requireMinimal$1();function $(){O.call(this)}$._configure=function(){$.alloc=N._Buffer_allocUnsafe,$.writeBytesBuffer=N.Buffer&&N.Buffer.prototype instanceof Uint8Array&&N.Buffer.prototype.set.name==="set"?function(k,i,c){i.set(k,c)}:function(k,i,c){if(k.copy)k.copy(i,c,0,k.length);else for(var S=0;S<k.length;)i[c++]=k[S++]}},$.prototype.bytes=function(k){N.isString(k)&&(k=N._Buffer_from(k,"base64"));var i=k.length>>>0;return this.uint32(i),i&&this._push($.writeBytesBuffer,i,k),this};function D(b,k,i){b.length<40?N.utf8.write(b,k,i):k.utf8Write?k.utf8Write(b,i):k.write(b,i)}return $.prototype.string=function(k){var i=N.Buffer.byteLength(k);return this.uint32(i),i&&this._push(D,i,k),this},$._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=k;var O=requireMinimal$1(),N,$=O.LongBits,D=O.utf8;function b(Z,J){return RangeError("index out of range: "+Z.pos+" + "+(J||1)+" > "+Z.len)}function k(Z){this.buf=Z,this.pos=0,this.len=Z.length}var i=typeof Uint8Array<"u"?function(J){if(J instanceof Uint8Array||Array.isArray(J))return new k(J);throw Error("illegal buffer")}:function(J){if(Array.isArray(J))return new k(J);throw Error("illegal buffer")},c=function(){return O.Buffer?function(z){return(k.create=function(re){return O.Buffer.isBuffer(re)?new N(re):i(re)})(z)}:i};k.create=c(),k.prototype._slice=O.Array.prototype.subarray||O.Array.prototype.slice,k.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,b(this,10);return J}}(),k.prototype.int32=function(){return this.uint32()|0},k.prototype.sint32=function(){var J=this.uint32();return J>>>1^-(J&1)|0};function S(){var Z=new $(0,0),J=0;if(this.len-this.pos>4){for(;J<4;++J)if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<J*7)>>>0,this.buf[this.pos++]<128)return Z;if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<28)>>>0,Z.hi=(Z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Z;J=0}else{for(;J<3;++J){if(this.pos>=this.len)throw b(this);if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<J*7)>>>0,this.buf[this.pos++]<128)return Z}return Z.lo=(Z.lo|(this.buf[this.pos++]&127)<<J*7)>>>0,Z}if(this.len-this.pos>4){for(;J<5;++J)if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<J*7+3)>>>0,this.buf[this.pos++]<128)return Z}else for(;J<5;++J){if(this.pos>=this.len)throw b(this);if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<J*7+3)>>>0,this.buf[this.pos++]<128)return Z}throw Error("invalid varint encoding")}k.prototype.bool=function(){return this.uint32()!==0};function C(Z,J){return(Z[J-4]|Z[J-3]<<8|Z[J-2]<<16|Z[J-1]<<24)>>>0}k.prototype.fixed32=function(){if(this.pos+4>this.len)throw b(this,4);return C(this.buf,this.pos+=4)},k.prototype.sfixed32=function(){if(this.pos+4>this.len)throw b(this,4);return C(this.buf,this.pos+=4)|0};function M(){if(this.pos+8>this.len)throw b(this,8);return new $(C(this.buf,this.pos+=4),C(this.buf,this.pos+=4))}return k.prototype.float=function(){if(this.pos+4>this.len)throw b(this,4);var J=O.float.readFloatLE(this.buf,this.pos);return this.pos+=4,J},k.prototype.double=function(){if(this.pos+8>this.len)throw b(this,4);var J=O.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,J},k.prototype.bytes=function(){var J=this.uint32(),z=this.pos,Y=this.pos+J;if(Y>this.len)throw b(this,J);if(this.pos+=J,Array.isArray(this.buf))return this.buf.slice(z,Y);if(z===Y){var re=O.Buffer;return re?re.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,z,Y)},k.prototype.string=function(){var J=this.bytes();return D.read(J,0,J.length)},k.prototype.skip=function(J){if(typeof J=="number"){if(this.pos+J>this.len)throw b(this,J);this.pos+=J}else do if(this.pos>=this.len)throw b(this);while(this.buf[this.pos++]&128);return this},k.prototype.skipType=function(Z){switch(Z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(Z=this.uint32()&7)!==4;)this.skipType(Z);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Z+" at offset "+this.pos)}return this},k._configure=function(Z){N=Z,k.create=c(),N._configure();var J=O.Long?"toLong":"toNumber";O.merge(k.prototype,{int64:function(){return S.call(this)[J](!1)},uint64:function(){return S.call(this)[J](!0)},sint64:function(){return S.call(this).zzDecode()[J](!1)},fixed64:function(){return M.call(this)[J](!0)},sfixed64:function(){return M.call(this)[J](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=$;var O=requireReader();($.prototype=Object.create(O.prototype)).constructor=$;var N=requireMinimal$1();function $(D){O.call(this,D)}return $._configure=function(){N.Buffer&&($.prototype._slice=N.Buffer.prototype.slice)},$.prototype.string=function(){var b=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+b,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+b,this.len))},$._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=N;var O=requireMinimal$1();(N.prototype=Object.create(O.EventEmitter.prototype)).constructor=N;function N($,D,b){if(typeof $!="function")throw TypeError("rpcImpl must be a function");O.EventEmitter.call(this),this.rpcImpl=$,this.requestDelimited=!!D,this.responseDelimited=!!b}return N.prototype.rpcCall=function $(D,b,k,i,c){if(!i)throw TypeError("request must be specified");var S=this;if(!c)return O.asPromise($,S,D,b,k,i);if(!S.rpcImpl){setTimeout(function(){c(Error("already ended"))},0);return}try{return S.rpcImpl(D,b[S.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(M,Z){if(M)return S.emit("error",M,D),c(M);if(Z===null){S.end(!0);return}if(!(Z instanceof k))try{Z=k[S.responseDelimited?"decodeDelimited":"decode"](Z)}catch(J){return S.emit("error",J,D),c(J)}return S.emit("data",Z,D),c(null,Z)})}catch(C){S.emit("error",C,D),setTimeout(function(){c(C)},0);return}},N.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(O){var N=O;N.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(O){var N=O;N.build="minimal",N.Writer=requireWriter(),N.BufferWriter=requireWriter_buffer(),N.Reader=requireReader(),N.BufferReader=requireReader_buffer(),N.util=requireMinimal$1(),N.rpc=requireRpc(),N.roots=requireRoots(),N.configure=$;function $(){N.util._configure(),N.Writer._configure(N.BufferWriter),N.Reader._configure(N.BufferReader)}$()}(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 O={};return O.quick=function(){const N={};return N.voice=function(){const $={};return $.proto=function(){const D={};return D.CommonReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.event="",b.prototype.data=$util.newBuffer([]),b.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.version=0,b.prototype.compress=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(56).bool(i.compress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.version=i.int32();break}case 7:{C.compress=i.bool();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let c=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},b.toObject=function(i,c){c||(c={});let S={};if(c.defaults){if(S.event="",c.bytes===String?S.data="":(S.data=[],c.bytes!==Array&&(S.data=$util.newBuffer(S.data))),$util.Long){let C=new $util.Long(0,0,!1);S.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);S.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);S.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.valid=c.longs===String?"0":0;S.version=0,S.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(S.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(S.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?S.sn=c.longs===String?String(i.sn):i.sn:S.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?S.time=c.longs===String?String(i.time):i.time:S.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?S.valid=c.longs===String?String(i.valid):i.valid:S.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&(S.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(S.compress=i.compress),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},b}(),D.CommonRsp=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.event="",b.prototype.data=$util.newBuffer([]),b.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.code=0,b.prototype.desc="",b.prototype.version=0,b.prototype.compress=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&c.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&c.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(72).bool(i.compress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.code=i.int32();break}case 7:{C.desc=i.string();break}case 8:{C.version=i.int32();break}case 9:{C.compress=i.bool();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let c=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(c.code=i.code|0),i.desc!=null&&(c.desc=String(i.desc)),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},b.toObject=function(i,c){c||(c={});let S={};if(c.defaults){if(S.event="",c.bytes===String?S.data="":(S.data=[],c.bytes!==Array&&(S.data=$util.newBuffer(S.data))),$util.Long){let C=new $util.Long(0,0,!1);S.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);S.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);S.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.valid=c.longs===String?"0":0;S.code=0,S.desc="",S.version=0,S.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(S.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(S.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?S.sn=c.longs===String?String(i.sn):i.sn:S.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?S.time=c.longs===String?String(i.time):i.time:S.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?S.valid=c.longs===String?String(i.valid):i.valid:S.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&(S.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&(S.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&(S.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(S.compress=i.compress),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},b}(),D.User=function(){function b(i){if(this.tracks=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.id="",b.prototype.callAction=null,b.prototype.callState=null,b.prototype.joinTime=null,b.prototype.tracks=$util.emptyArray,b.prototype.permissions=null,b.prototype.isPublished=null,b.prototype.behavior=null,b.prototype.channelCache=null;let k;return Object.defineProperty(b.prototype,"_callAction",{get:$util.oneOfGetter(k=["callAction"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_callState",{get:$util.oneOfGetter(k=["callState"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_joinTime",{get:$util.oneOfGetter(k=["joinTime"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_permissions",{get:$util.oneOfGetter(k=["permissions"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_isPublished",{get:$util.oneOfGetter(k=["isPublished"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_behavior",{get:$util.oneOfGetter(k=["behavior"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_channelCache",{get:$util.oneOfGetter(k=["channelCache"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&S.uint32(10).string(c.id),c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&S.uint32(16).int32(c.callAction),c.callState!=null&&Object.hasOwnProperty.call(c,"callState")&&S.uint32(24).int32(c.callState),c.joinTime!=null&&Object.hasOwnProperty.call(c,"joinTime")&&S.uint32(32).int64(c.joinTime),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],S.uint32(42).fork()).ldelim();return c.permissions!=null&&Object.hasOwnProperty.call(c,"permissions")&&S.uint32(48).int32(c.permissions),c.isPublished!=null&&Object.hasOwnProperty.call(c,"isPublished")&&S.uint32(56).bool(c.isPublished),c.behavior!=null&&Object.hasOwnProperty.call(c,"behavior")&&S.uint32(64).int32(c.behavior),c.channelCache!=null&&Object.hasOwnProperty.call(c,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(c.channelCache,S.uint32(74).fork()).ldelim(),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.User;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.id=c.string();break}case 2:{M.callAction=c.int32();break}case 3:{M.callState=c.int32();break}case 4:{M.joinTime=c.int64();break}case 5:{M.tracks&&M.tracks.length||(M.tracks=[]),M.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 6:{M.permissions=c.int32();break}case 7:{M.isPublished=c.bool();break}case 8:{M.behavior=c.int32();break}case 9:{M.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(c,c.uint32());break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.id!=null&&c.hasOwnProperty("id")&&!$util.isString(c.id))return"id: string expected";if(c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction))return"callAction: integer expected";if(c.callState!=null&&c.hasOwnProperty("callState")&&!$util.isInteger(c.callState))return"callState: integer expected";if(c.joinTime!=null&&c.hasOwnProperty("joinTime")&&!$util.isInteger(c.joinTime)&&!(c.joinTime&&$util.isInteger(c.joinTime.low)&&$util.isInteger(c.joinTime.high)))return"joinTime: integer|Long expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let S=0;S<c.tracks.length;++S){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[S]);if(C)return"tracks."+C}}if(c.permissions!=null&&c.hasOwnProperty("permissions")&&!$util.isInteger(c.permissions))return"permissions: integer expected";if(c.isPublished!=null&&c.hasOwnProperty("isPublished")&&typeof c.isPublished!="boolean")return"isPublished: boolean expected";if(c.behavior!=null&&c.hasOwnProperty("behavior")&&!$util.isInteger(c.behavior))return"behavior: integer expected";if(c.channelCache!=null&&c.hasOwnProperty("channelCache")){let S=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(c.channelCache);if(S)return"channelCache."+S}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.User)return c;let S=new $root.com.quick.voice.proto.User;if(c.id!=null&&(S.id=String(c.id)),c.callAction!=null&&(S.callAction=c.callAction|0),c.callState!=null&&(S.callState=c.callState|0),c.joinTime!=null&&($util.Long?(S.joinTime=$util.Long.fromValue(c.joinTime)).unsigned=!1:typeof c.joinTime=="string"?S.joinTime=parseInt(c.joinTime,10):typeof c.joinTime=="number"?S.joinTime=c.joinTime:typeof c.joinTime=="object"&&(S.joinTime=new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber())),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");S.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");S.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}if(c.permissions!=null&&(S.permissions=c.permissions|0),c.isPublished!=null&&(S.isPublished=!!c.isPublished),c.behavior!=null&&(S.behavior=c.behavior|0),c.channelCache!=null){if(typeof c.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");S.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(c.channelCache)}return S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.tracks=[]),S.defaults&&(C.id=""),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id),c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction,S.oneofs&&(C._callAction="callAction")),c.callState!=null&&c.hasOwnProperty("callState")&&(C.callState=c.callState,S.oneofs&&(C._callState="callState")),c.joinTime!=null&&c.hasOwnProperty("joinTime")&&(typeof c.joinTime=="number"?C.joinTime=S.longs===String?String(c.joinTime):c.joinTime:C.joinTime=S.longs===String?$util.Long.prototype.toString.call(c.joinTime):S.longs===Number?new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber():c.joinTime,S.oneofs&&(C._joinTime="joinTime")),c.tracks&&c.tracks.length){C.tracks=[];for(let M=0;M<c.tracks.length;++M)C.tracks[M]=$root.com.quick.voice.proto.Track.toObject(c.tracks[M],S)}return c.permissions!=null&&c.hasOwnProperty("permissions")&&(C.permissions=c.permissions,S.oneofs&&(C._permissions="permissions")),c.isPublished!=null&&c.hasOwnProperty("isPublished")&&(C.isPublished=c.isPublished,S.oneofs&&(C._isPublished="isPublished")),c.behavior!=null&&c.hasOwnProperty("behavior")&&(C.behavior=c.behavior,S.oneofs&&(C._behavior="behavior")),c.channelCache!=null&&c.hasOwnProperty("channelCache")&&(C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(c.channelCache,S),S.oneofs&&(C._channelCache="channelCache")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.User"},b}(),D.DataChannelCacheInfo=function(){function b(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let S=0;S<i.channels.length;++S)$root.com.quick.voice.proto.DataChannel.encode(i.channels[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let S=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(S)return"channels."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let c=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");c.channels=[];for(let S=0;S<i.channels.length;++S){if(typeof i.channels[S]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");c.channels[S]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.channels=[]),i.channels&&i.channels.length){S.channels=[];for(let C=0;C<i.channels.length;++C)S.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},b}(),D.DataChannel=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.dataChannelName="",b.prototype.id=null;let k;return Object.defineProperty(b.prototype,"_id",{get:$util.oneOfGetter(k=["id"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.dataChannelName!=null&&Object.hasOwnProperty.call(c,"dataChannelName")&&S.uint32(10).string(c.dataChannelName),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&S.uint32(16).int32(c.id),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.DataChannel;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.dataChannelName=c.string();break}case 2:{M.id=c.int32();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){return typeof c!="object"||c===null?"object expected":c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&!$util.isString(c.dataChannelName)?"dataChannelName: string expected":c.id!=null&&c.hasOwnProperty("id")&&!$util.isInteger(c.id)?"id: integer expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannel)return c;let S=new $root.com.quick.voice.proto.DataChannel;return c.dataChannelName!=null&&(S.dataChannelName=String(c.dataChannelName)),c.id!=null&&(S.id=c.id|0),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.dataChannelName=""),c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&(C.dataChannelName=c.dataChannelName),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id,S.oneofs&&(C._id="id")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannel"},b}(),D.Login=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.appid="",b.prototype.userId="",b.prototype.sdkToken="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&c.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(26).string(i.sdkToken),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Login;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.appid=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.sdkToken=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let c=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(c.appid=String(i.appid)),i.userId!=null&&(c.userId=String(i.userId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.appid="",S.userId="",S.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&(S.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(S.sdkToken=i.sdkToken),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},b}(),D.Track=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.mid="",b.prototype.trackName=null,b.prototype.location=null,b.prototype.userId=null,b.prototype.code=null,b.prototype.desc=null,b.prototype.type=null,b.prototype.isValid=null,b.prototype.simulcast=null;let k;return Object.defineProperty(b.prototype,"_trackName",{get:$util.oneOfGetter(k=["trackName"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_location",{get:$util.oneOfGetter(k=["location"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_userId",{get:$util.oneOfGetter(k=["userId"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_type",{get:$util.oneOfGetter(k=["type"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_isValid",{get:$util.oneOfGetter(k=["isValid"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_simulcast",{get:$util.oneOfGetter(k=["simulcast"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.mid!=null&&Object.hasOwnProperty.call(c,"mid")&&S.uint32(10).string(c.mid),c.trackName!=null&&Object.hasOwnProperty.call(c,"trackName")&&S.uint32(18).string(c.trackName),c.location!=null&&Object.hasOwnProperty.call(c,"location")&&S.uint32(26).string(c.location),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&S.uint32(34).string(c.userId),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&S.uint32(40).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&S.uint32(50).string(c.desc),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&S.uint32(56).int32(c.type),c.isValid!=null&&Object.hasOwnProperty.call(c,"isValid")&&S.uint32(64).bool(c.isValid),c.simulcast!=null&&Object.hasOwnProperty.call(c,"simulcast")&&S.uint32(74).string(c.simulcast),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.Track;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.mid=c.string();break}case 2:{M.trackName=c.string();break}case 3:{M.location=c.string();break}case 4:{M.userId=c.string();break}case 5:{M.code=c.int32();break}case 6:{M.desc=c.string();break}case 7:{M.type=c.int32();break}case 8:{M.isValid=c.bool();break}case 9:{M.simulcast=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.mid!=null&&c.hasOwnProperty("mid")&&!$util.isString(c.mid))return"mid: string expected";if(c.trackName!=null&&c.hasOwnProperty("trackName")&&!$util.isString(c.trackName))return"trackName: string expected";if(c.location!=null&&c.hasOwnProperty("location")&&!$util.isString(c.location))return"location: string expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code))return"code: integer expected";if(c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc))return"desc: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return c.isValid!=null&&c.hasOwnProperty("isValid")&&typeof c.isValid!="boolean"?"isValid: boolean expected":c.simulcast!=null&&c.hasOwnProperty("simulcast")&&!$util.isString(c.simulcast)?"simulcast: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.Track)return c;let S=new $root.com.quick.voice.proto.Track;switch(c.mid!=null&&(S.mid=String(c.mid)),c.trackName!=null&&(S.trackName=String(c.trackName)),c.location!=null&&(S.location=String(c.location)),c.userId!=null&&(S.userId=String(c.userId)),c.code!=null&&(S.code=c.code|0),c.desc!=null&&(S.desc=String(c.desc)),c.type){default:if(typeof c.type=="number"){S.type=c.type;break}break;case"Microphone":case 0:S.type=0;break;case"Camera":case 1:S.type=1;break;case"Screen":case 2:S.type=2;break;case"SystemVoice":case 3:S.type=3;break}return c.isValid!=null&&(S.isValid=!!c.isValid),c.simulcast!=null&&(S.simulcast=String(c.simulcast)),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.mid=""),c.mid!=null&&c.hasOwnProperty("mid")&&(C.mid=c.mid),c.trackName!=null&&c.hasOwnProperty("trackName")&&(C.trackName=c.trackName,S.oneofs&&(C._trackName="trackName")),c.location!=null&&c.hasOwnProperty("location")&&(C.location=c.location,S.oneofs&&(C._location="location")),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId,S.oneofs&&(C._userId="userId")),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,S.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,S.oneofs&&(C._desc="desc")),c.type!=null&&c.hasOwnProperty("type")&&(C.type=S.enums===String?$root.com.quick.voice.proto.TrackType[c.type]===void 0?c.type:$root.com.quick.voice.proto.TrackType[c.type]:c.type,S.oneofs&&(C._type="type")),c.isValid!=null&&c.hasOwnProperty("isValid")&&(C.isValid=c.isValid,S.oneofs&&(C._isValid="isValid")),c.simulcast!=null&&c.hasOwnProperty("simulcast")&&(C.simulcast=c.simulcast,S.oneofs&&(C._simulcast="simulcast")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.Track"},b}(),D.JoinReq=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.callType=0,b.prototype.token=null;let k;return Object.defineProperty(b.prototype,"_token",{get:$util.oneOfGetter(k=["token"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&S.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,S.uint32(18).fork()).ldelim(),c.callType!=null&&Object.hasOwnProperty.call(c,"callType")&&S.uint32(24).int32(c.callType),c.token!=null&&Object.hasOwnProperty.call(c,"token")&&S.uint32(34).string(c.token),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.JoinReq;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.roomId=c.string();break}case 2:{M.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{M.callType=c.int32();break}case 4:{M.token=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let S=$root.com.quick.voice.proto.User.verify(c.user);if(S)return"user."+S}if(c.callType!=null&&c.hasOwnProperty("callType"))switch(c.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return c.token!=null&&c.hasOwnProperty("token")&&!$util.isString(c.token)?"token: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.JoinReq)return c;let S=new $root.com.quick.voice.proto.JoinReq;if(c.roomId!=null&&(S.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");S.user=$root.com.quick.voice.proto.User.fromObject(c.user)}switch(c.callType){default:if(typeof c.callType=="number"){S.callType=c.callType;break}break;case"Normal":case 0:S.callType=0;break;case"Meeting":case 1:S.callType=1;break;case"Live":case 2:S.callType=2;break}return c.token!=null&&(S.token=String(c.token)),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.roomId="",C.user=null,C.callType=S.enums===String?"Normal":0),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,S)),c.callType!=null&&c.hasOwnProperty("callType")&&(C.callType=S.enums===String?$root.com.quick.voice.proto.CallType[c.callType]===void 0?c.callType:$root.com.quick.voice.proto.CallType[c.callType]:c.callType),c.token!=null&&c.hasOwnProperty("token")&&(C.token=c.token,S.oneofs&&(C._token="token")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.JoinReq"},b}(),D.JoinRsp=function(){function b(k){if(this.roomUsers=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.roomUsers=$util.emptyArray,b.prototype.callType=0,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let S=0;S<i.roomUsers.length;++S)$root.com.quick.voice.proto.User.encode(i.roomUsers[S],c.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&c.uint32(24).int32(i.callType),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{C.callType=i.int32();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let S=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if(S)return"roomUsers."+S}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let c=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");c.roomUsers=[];for(let S=0;S<i.roomUsers.length;++S){if(typeof i.roomUsers[S]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");c.roomUsers[S]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[S])}}switch(i.callType){default:if(typeof i.callType=="number"){c.callType=i.callType;break}break;case"Normal":case 0:c.callType=0;break;case"Meeting":case 1:c.callType=1;break;case"Live":case 2:c.callType=2;break}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.roomUsers=[]),c.defaults&&(S.roomId="",S.callType=c.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){S.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)S.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return i.callType!=null&&i.hasOwnProperty("callType")&&(S.callType=c.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},b}(),D.JoinNotify=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let c=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId="",S.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(S.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},b}(),D.ConnectCFReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.sdp="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.sdp=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let c=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(c.sdp=String(i.sdp)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(S.sdp=i.sdp),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},b}(),D.ConnectCFRsp=function(){function b(i){if(this.subscribeUsers=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.remoteSdp="",b.prototype.subscribeUsers=$util.emptyArray,b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&S.uint32(10).string(c.remoteSdp),c.subscribeUsers!=null&&c.subscribeUsers.length)for(let C=0;C<c.subscribeUsers.length;++C)$root.com.quick.voice.proto.User.encode(c.subscribeUsers[C],S.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(26).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.ConnectCFRsp;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.remoteSdp=c.string();break}case 2:{M.subscribeUsers&&M.subscribeUsers.length||(M.subscribeUsers=[]),M.subscribeUsers.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.subscribeUsers!=null&&c.hasOwnProperty("subscribeUsers")){if(!Array.isArray(c.subscribeUsers))return"subscribeUsers: array expected";for(let S=0;S<c.subscribeUsers.length;++S){let C=$root.com.quick.voice.proto.User.verify(c.subscribeUsers[S]);if(C)return"subscribeUsers."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ConnectCFRsp)return c;let S=new $root.com.quick.voice.proto.ConnectCFRsp;if(c.remoteSdp!=null&&(S.remoteSdp=String(c.remoteSdp)),c.subscribeUsers){if(!Array.isArray(c.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");S.subscribeUsers=[];for(let C=0;C<c.subscribeUsers.length;++C){if(typeof c.subscribeUsers[C]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");S.subscribeUsers[C]=$root.com.quick.voice.proto.User.fromObject(c.subscribeUsers[C])}}return c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.subscribeUsers=[]),S.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.subscribeUsers&&c.subscribeUsers.length){C.subscribeUsers=[];for(let M=0;M<c.subscribeUsers.length;++M)C.subscribeUsers[M]=$root.com.quick.voice.proto.User.toObject(c.subscribeUsers[M],S)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ConnectCFRsp"},b}(),D.PublishReq=function(){function b(i){if(this.tracks=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.sdp="",b.prototype.tracks=$util.emptyArray,b.prototype.callAction=0,b.prototype.recreate=null,b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_recreate",{get:$util.oneOfGetter(k=["recreate"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&S.uint32(10).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],S.uint32(18).fork()).ldelim();return c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&S.uint32(24).int32(c.callAction),c.recreate!=null&&Object.hasOwnProperty.call(c,"recreate")&&S.uint32(32).bool(c.recreate),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(42).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.PublishReq;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.sdp=c.string();break}case 2:{M.tracks&&M.tracks.length||(M.tracks=[]),M.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 3:{M.callAction=c.int32();break}case 4:{M.recreate=c.bool();break}case 5:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let S=0;S<c.tracks.length;++S){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[S]);if(C)return"tracks."+C}}return c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction)?"callAction: integer expected":c.recreate!=null&&c.hasOwnProperty("recreate")&&typeof c.recreate!="boolean"?"recreate: boolean expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishReq)return c;let S=new $root.com.quick.voice.proto.PublishReq;if(c.sdp!=null&&(S.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");S.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");S.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return c.callAction!=null&&(S.callAction=c.callAction|0),c.recreate!=null&&(S.recreate=!!c.recreate),c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.tracks=[]),S.defaults&&(C.sdp="",C.callAction=0),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let M=0;M<c.tracks.length;++M)C.tracks[M]=$root.com.quick.voice.proto.Track.toObject(c.tracks[M],S)}return c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction),c.recreate!=null&&c.hasOwnProperty("recreate")&&(C.recreate=c.recreate,S.oneofs&&(C._recreate="recreate")),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishReq"},b}(),D.PublishRsp=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.remoteSdp="",b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&S.uint32(10).string(c.remoteSdp),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(18).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.PublishRsp;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.remoteSdp=c.string();break}case 2:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){return typeof c!="object"||c===null?"object expected":c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp)?"remoteSdp: string expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishRsp)return c;let S=new $root.com.quick.voice.proto.PublishRsp;return c.remoteSdp!=null&&(S.remoteSdp=String(c.remoteSdp)),c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishRsp"},b}(),D.PublishNotify=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&S.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,S.uint32(18).fork()).ldelim(),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(26).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.PublishNotify;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.roomId=c.string();break}case 2:{M.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let S=$root.com.quick.voice.proto.User.verify(c.user);if(S)return"user."+S}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishNotify)return c;let S=new $root.com.quick.voice.proto.PublishNotify;if(c.roomId!=null&&(S.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");S.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,S)),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishNotify"},b}(),D.SubscribeReq=function(){function b(i){if(this.users=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.users=$util.emptyArray,b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],S.uint32(10).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(18).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.SubscribeReq;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.users&&M.users.length||(M.users=[]),M.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 2:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let S=0;S<c.users.length;++S){let C=$root.com.quick.voice.proto.User.verify(c.users[S]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeReq)return c;let S=new $root.com.quick.voice.proto.SubscribeReq;if(c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");S.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");S.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.users=[]),c.users&&c.users.length){C.users=[];for(let M=0;M<c.users.length;++M)C.users[M]=$root.com.quick.voice.proto.User.toObject(c.users[M],S)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeReq"},b}(),D.SubscribeRsp=function(){function b(i){if(this.users=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.remoteSdp="",b.prototype.users=$util.emptyArray,b.prototype.session=null;let k;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(k=["session"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&S.uint32(10).string(c.remoteSdp),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],S.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&S.uint32(26).string(c.session),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.SubscribeRsp;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.remoteSdp=c.string();break}case 2:{M.users&&M.users.length||(M.users=[]),M.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{M.session=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let S=0;S<c.users.length;++S){let C=$root.com.quick.voice.proto.User.verify(c.users[S]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeRsp)return c;let S=new $root.com.quick.voice.proto.SubscribeRsp;if(c.remoteSdp!=null&&(S.remoteSdp=String(c.remoteSdp)),c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");S.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");S.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(S.session=String(c.session)),S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.users=[]),S.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.users&&c.users.length){C.users=[];for(let M=0;M<c.users.length;++M)C.users[M]=$root.com.quick.voice.proto.User.toObject(c.users[M],S)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,S.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeRsp"},b}(),D.RenegotiateReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.userId="",b.prototype.sdp="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(18).string(i.sdp),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.sdp=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let c=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(c.userId=String(i.userId)),i.sdp!=null&&(c.sdp=String(i.sdp)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.userId="",S.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&(S.sdp=i.sdp),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},b}(),D.QuitReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.userId="",b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let c=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.userId="",S.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},b}(),D.QuitNotify=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.code=null,b.prototype.desc=null;let k;return Object.defineProperty(b.prototype,"_code",{get:$util.oneOfGetter(k=["code"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_desc",{get:$util.oneOfGetter(k=["desc"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&S.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,S.uint32(18).fork()).ldelim(),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&S.uint32(24).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&S.uint32(34).string(c.desc),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.QuitNotify;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.roomId=c.string();break}case 2:{M.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{M.code=c.int32();break}case 4:{M.desc=c.string();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let S=$root.com.quick.voice.proto.User.verify(c.user);if(S)return"user."+S}return c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code)?"code: integer expected":c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc)?"desc: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.QuitNotify)return c;let S=new $root.com.quick.voice.proto.QuitNotify;if(c.roomId!=null&&(S.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");S.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.code!=null&&(S.code=c.code|0),c.desc!=null&&(S.desc=String(c.desc)),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,S)),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,S.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,S.oneofs&&(C._desc="desc")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.QuitNotify"},b}(),D.TokenExpireNotify=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let c=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},b}(),D.UpdateTokenReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.sdkToken="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(18).string(i.sdkToken),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.sdkToken=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let c=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId="",S.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(S.sdkToken=i.sdkToken),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},b}(),D.NetQualityChange=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.userId="",b.prototype.roomId="",b.prototype.egress=0,b.prototype.ingress=0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&c.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&c.uint32(32).int32(i.ingress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}case 3:{C.egress=i.int32();break}case 4:{C.ingress=i.int32();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let c=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),i.egress!=null&&(c.egress=i.egress|0),i.ingress!=null&&(c.ingress=i.ingress|0),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.userId="",S.roomId="",S.egress=0,S.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&(S.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&(S.ingress=i.ingress),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},b}(),D.NetQualityNotify=function(){function b(k){if(this.qualities=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.qualities=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let S=0;S<i.qualities.length;++S)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.qualities&&C.qualities.length||(C.qualities=[]),C.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let c=0;c<i.qualities.length;++c){let S=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[c]);if(S)return"qualities."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let c=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");c.qualities=[];for(let S=0;S<i.qualities.length;++S){if(typeof i.qualities[S]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");c.qualities[S]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.qualities=[]),i.qualities&&i.qualities.length){S.qualities=[];for(let C=0;C<i.qualities.length;++C)S.qualities[C]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},b}(),D.UpdateCall=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let c=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId="",S.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(S.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},b}(),D.SyncRoomInfoReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId="",S.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(S.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},b}(),D.SyncRoomInfoRsp=function(){function b(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.isValid=!1,b.prototype.users=$util.emptyArray,b.prototype.isActive=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&c.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let S=0;S<i.users.length;++S)$root.com.quick.voice.proto.User.encode(i.users[S],c.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&c.uint32(32).bool(i.isActive),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.isValid=i.bool();break}case 3:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{C.isActive=i.bool();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let S=$root.com.quick.voice.proto.User.verify(i.users[c]);if(S)return"users."+S}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.isValid!=null&&(c.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");c.users=[];for(let S=0;S<i.users.length;++S){if(typeof i.users[S]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");c.users[S]=$root.com.quick.voice.proto.User.fromObject(i.users[S])}}return i.isActive!=null&&(c.isActive=!!i.isActive),c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.users=[]),c.defaults&&(S.roomId="",S.isValid=!1,S.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&(S.isValid=i.isValid),i.users&&i.users.length){S.users=[];for(let C=0;C<i.users.length;++C)S.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&(S.isActive=i.isActive),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},b}(),D.UpdateTime=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(8).int64(i.time),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.time=i.int64();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let c=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),c},b.toObject=function(i,c){c||(c={});let S={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);S.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.time=c.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?S.time=c.longs===String?String(i.time):i.time:S.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},b}(),D.CloseTrackReq=function(){function b(k){if(this.tracks=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.sdp="",b.prototype.tracks=$util.emptyArray,b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let S=0;S<i.tracks.length;++S)$root.com.quick.voice.proto.Track.encode(i.tracks[S],c.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(26).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.sdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let S=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(S)return"tracks."+S}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let c=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(c.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");c.tracks=[];for(let S=0;S<i.tracks.length;++S){if(typeof i.tracks[S]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");c.tracks[S]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[S])}}return i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.tracks=[]),c.defaults&&(S.sdp="",S.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(S.sdp=i.sdp),i.tracks&&i.tracks.length){S.tracks=[];for(let C=0;C<i.tracks.length;++C)S.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},b}(),D.CloseTrackRsp=function(){function b(k){if(this.tracks=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.remoteSdp="",b.prototype.tracks=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let S=0;S<i.tracks.length;++S)$root.com.quick.voice.proto.Track.encode(i.tracks[S],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let S=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(S)return"tracks."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let c=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");c.tracks=[];for(let S=0;S<i.tracks.length;++S){if(typeof i.tracks[S]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");c.tracks[S]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.tracks=[]),c.defaults&&(S.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&(S.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){S.tracks=[];for(let C=0;C<i.tracks.length;++C)S.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},b}(),D.CloseTrackNotify=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(10).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let c=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.user=null),i.user!=null&&i.hasOwnProperty("user")&&(S.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},b}(),D.ToggleLiveRoomReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return i;let c=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ToggleLiveRoomReq"},b}(),D.ToggleLiveRoomRsq=function(){function b(k){if(this.roomUsers=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.hash="",b.prototype.roomUsers=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.hash!=null&&Object.hasOwnProperty.call(i,"hash")&&c.uint32(18).string(i.hash),i.roomUsers!=null&&i.roomUsers.length)for(let S=0;S<i.roomUsers.length;++S)$root.com.quick.voice.proto.User.encode(i.roomUsers[S],c.uint32(26).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.hash=i.string();break}case 3:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.hash!=null&&i.hasOwnProperty("hash")&&!$util.isString(i.hash))return"hash: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let S=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if(S)return"roomUsers."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return i;let c=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.hash!=null&&(c.hash=String(i.hash)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");c.roomUsers=[];for(let S=0;S<i.roomUsers.length;++S){if(typeof i.roomUsers[S]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");c.roomUsers[S]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.roomUsers=[]),c.defaults&&(S.roomId="",S.hash=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.hash!=null&&i.hasOwnProperty("hash")&&(S.hash=i.hash),i.roomUsers&&i.roomUsers.length){S.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)S.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ToggleLiveRoomRsq"},b}(),D.TrackType=function(){const b={},k=Object.create(b);return k[b[0]="Microphone"]=0,k[b[1]="Camera"]=1,k[b[2]="Screen"]=2,k[b[3]="SystemVoice"]=3,k}(),D.ReportInfoReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.actionEvent="",b.prototype.userId="",b.prototype.platform="",b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.actionData="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.actionEvent!=null&&Object.hasOwnProperty.call(i,"actionEvent")&&c.uint32(10).string(i.actionEvent),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.platform!=null&&Object.hasOwnProperty.call(i,"platform")&&c.uint32(26).string(i.platform),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.actionData!=null&&Object.hasOwnProperty.call(i,"actionData")&&c.uint32(42).string(i.actionData),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ReportInfoReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.actionEvent=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.platform=i.string();break}case 4:{C.time=i.int64();break}case 5:{C.actionData=i.string();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.actionEvent!=null&&i.hasOwnProperty("actionEvent")&&!$util.isString(i.actionEvent)?"actionEvent: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.platform!=null&&i.hasOwnProperty("platform")&&!$util.isString(i.platform)?"platform: string expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.actionData!=null&&i.hasOwnProperty("actionData")&&!$util.isString(i.actionData)?"actionData: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportInfoReq)return i;let c=new $root.com.quick.voice.proto.ReportInfoReq;return i.actionEvent!=null&&(c.actionEvent=String(i.actionEvent)),i.userId!=null&&(c.userId=String(i.userId)),i.platform!=null&&(c.platform=String(i.platform)),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.actionData!=null&&(c.actionData=String(i.actionData)),c},b.toObject=function(i,c){c||(c={});let S={};if(c.defaults){if(S.actionEvent="",S.userId="",S.platform="",$util.Long){let C=new $util.Long(0,0,!1);S.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.time=c.longs===String?"0":0;S.actionData=""}return i.actionEvent!=null&&i.hasOwnProperty("actionEvent")&&(S.actionEvent=i.actionEvent),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.platform!=null&&i.hasOwnProperty("platform")&&(S.platform=i.platform),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?S.time=c.longs===String?String(i.time):i.time:S.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.actionData!=null&&i.hasOwnProperty("actionData")&&(S.actionData=i.actionData),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportInfoReq"},b}(),D.UpdatePermissions=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let c=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.roomId="",S.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(S.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},b}(),D.CallType=function(){const b={},k=Object.create(b);return k[b[0]="Normal"]=0,k[b[1]="Meeting"]=1,k[b[2]="Live"]=2,k}(),D.QuitNotifyCode=function(){const b={},k=Object.create(b);return k[b[0]="NormalQuit"]=0,k[b[2021]="Timeout"]=2021,k[b[2011]="TokenExpired"]=2011,k[b[2022]="KickOut"]=2022,k[b[2023]="EndPk"]=2023,k[b[2024]="EndLive"]=2024,k}(),D.UserBehavior=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.type=0,b.prototype.behavior=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&c.uint32(16).bool(i.behavior),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.type=i.int32();break}case 2:{C.behavior=i.bool();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let c=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Microphone":case 0:c.type=0;break;case"Camera":case 1:c.type=1;break;case"Screen":case 2:c.type=2;break;case"SystemVoice":case 3:c.type=3;break}return i.behavior!=null&&(c.behavior=!!i.behavior),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.type=c.enums===String?"Microphone":0,S.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&(S.type=c.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&(S.behavior=i.behavior),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},b}(),D.PreventUser=function(){function b(k){if(this.behaviors=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.id="",b.prototype.behaviors=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&c.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let S=0;S<i.behaviors.length;++S)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[S],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.id=i.string();break}case 2:{C.behaviors&&C.behaviors.length||(C.behaviors=[]),C.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let c=0;c<i.behaviors.length;++c){let S=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[c]);if(S)return"behaviors."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let c=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(c.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");c.behaviors=[];for(let S=0;S<i.behaviors.length;++S){if(typeof i.behaviors[S]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");c.behaviors[S]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.behaviors=[]),c.defaults&&(S.id=""),i.id!=null&&i.hasOwnProperty("id")&&(S.id=i.id),i.behaviors&&i.behaviors.length){S.behaviors=[];for(let C=0;C<i.behaviors.length;++C)S.behaviors[C]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},b}(),D.PreventUsersBehaviorReq=function(){function b(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let S=0;S<i.users.length;++S)$root.com.quick.voice.proto.PreventUser.encode(i.users[S],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let S=$root.com.quick.voice.proto.PreventUser.verify(i.users[c]);if(S)return"users."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");c.users=[];for(let S=0;S<i.users.length;++S){if(typeof i.users[S]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");c.users[S]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.users=[]),c.defaults&&(S.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.users&&i.users.length){S.users=[];for(let C=0;C<i.users.length;++C)S.users[C]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},b}(),D.PreventUsersBehaviorNotify=function(){function b(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.roomId="",b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let S=0;S<i.users.length;++S)$root.com.quick.voice.proto.User.encode(i.users[S],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let S=$root.com.quick.voice.proto.User.verify(i.users[c]);if(S)return"users."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");c.users=[];for(let S=0;S<i.users.length;++S){if(typeof i.users[S]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");c.users[S]=$root.com.quick.voice.proto.User.fromObject(i.users[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.users=[]),c.defaults&&(S.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(S.roomId=i.roomId),i.users&&i.users.length){S.users=[];for(let C=0;C<i.users.length;++C)S.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},b}(),D.AccelerationAreas=function(){const b={},k=Object.create(b);return k[b[0]="chinaMainland"]=0,k[b[1]="global"]=1,k[b[2]="overseas"]=2,k}(),D.CountMethods=function(){const b={},k=Object.create(b);return k[b[0]="flow"]=0,k[b[1]="minutes"]=1,k}(),D.BaseCDNAddress=function(){function b(k){if(this.urlMap={},k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.area=0,b.prototype.countType=0,b.prototype.urlMap=$util.emptyObject,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&c.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&c.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let S=Object.keys(i.urlMap),C=0;C<S.length;++C)c.uint32(26).fork().uint32(10).string(S[C]).uint32(18).string(i.urlMap[S[C]]).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.BaseCDNAddress,M,Z;for(;i.pos<S;){let J=i.uint32();switch(J>>>3){case 1:{C.area=i.int32();break}case 2:{C.countType=i.int32();break}case 3:{C.urlMap===$util.emptyObject&&(C.urlMap={});let z=i.uint32()+i.pos;for(M="",Z="";i.pos<z;){let Y=i.uint32();switch(Y>>>3){case 1:M=i.string();break;case 2:Z=i.string();break;default:i.skipType(Y&7);break}}C.urlMap[M]=Z;break}default:i.skipType(J&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let c=Object.keys(i.urlMap);for(let S=0;S<c.length;++S)if(!$util.isString(i.urlMap[c[S]]))return"urlMap: string{k:string} expected"}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let c=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){c.area=i.area;break}break;case"chinaMainland":case 0:c.area=0;break;case"global":case 1:c.area=1;break;case"overseas":case 2:c.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){c.countType=i.countType;break}break;case"flow":case 0:c.countType=0;break;case"minutes":case 1:c.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");c.urlMap={};for(let S=Object.keys(i.urlMap),C=0;C<S.length;++C)c.urlMap[S[C]]=String(i.urlMap[S[C]])}return c},b.toObject=function(i,c){c||(c={});let S={};(c.objects||c.defaults)&&(S.urlMap={}),c.defaults&&(S.area=c.enums===String?"chinaMainland":0,S.countType=c.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&(S.area=c.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&(S.countType=c.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let C;if(i.urlMap&&(C=Object.keys(i.urlMap)).length){S.urlMap={};for(let M=0;M<C.length;++M)S.urlMap[C[M]]=i.urlMap[C[M]]}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},b}(),D.CDNPlayAddressNotify=function(){function b(i){if(this.standLines=[],i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.roomId="",b.prototype.m3u8=null,b.prototype.rtmp=null,b.prototype.flv=null,b.prototype.rtmps=null,b.prototype.mainLine=null,b.prototype.standLines=$util.emptyArray;let k;return Object.defineProperty(b.prototype,"_m3u8",{get:$util.oneOfGetter(k=["m3u8"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_rtmp",{get:$util.oneOfGetter(k=["rtmp"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_flv",{get:$util.oneOfGetter(k=["flv"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_rtmps",{get:$util.oneOfGetter(k=["rtmps"]),set:$util.oneOfSetter(k)}),Object.defineProperty(b.prototype,"_mainLine",{get:$util.oneOfGetter(k=["mainLine"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){if(S||(S=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&S.uint32(10).string(c.roomId),c.m3u8!=null&&Object.hasOwnProperty.call(c,"m3u8")&&S.uint32(18).string(c.m3u8),c.rtmp!=null&&Object.hasOwnProperty.call(c,"rtmp")&&S.uint32(26).string(c.rtmp),c.flv!=null&&Object.hasOwnProperty.call(c,"flv")&&S.uint32(34).string(c.flv),c.rtmps!=null&&Object.hasOwnProperty.call(c,"rtmps")&&S.uint32(42).string(c.rtmps),c.mainLine!=null&&Object.hasOwnProperty.call(c,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(c.mainLine,S.uint32(50).fork()).ldelim(),c.standLines!=null&&c.standLines.length)for(let C=0;C<c.standLines.length;++C)$root.com.quick.voice.proto.BaseCDNAddress.encode(c.standLines[C],S.uint32(58).fork()).ldelim();return S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.roomId=c.string();break}case 2:{M.m3u8=c.string();break}case 3:{M.rtmp=c.string();break}case 4:{M.flv=c.string();break}case 5:{M.rtmps=c.string();break}case 6:{M.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32());break}case 7:{M.standLines&&M.standLines.length||(M.standLines=[]),M.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32()));break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.m3u8!=null&&c.hasOwnProperty("m3u8")&&!$util.isString(c.m3u8))return"m3u8: string expected";if(c.rtmp!=null&&c.hasOwnProperty("rtmp")&&!$util.isString(c.rtmp))return"rtmp: string expected";if(c.flv!=null&&c.hasOwnProperty("flv")&&!$util.isString(c.flv))return"flv: string expected";if(c.rtmps!=null&&c.hasOwnProperty("rtmps")&&!$util.isString(c.rtmps))return"rtmps: string expected";if(c.mainLine!=null&&c.hasOwnProperty("mainLine")){let S=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.mainLine);if(S)return"mainLine."+S}if(c.standLines!=null&&c.hasOwnProperty("standLines")){if(!Array.isArray(c.standLines))return"standLines: array expected";for(let S=0;S<c.standLines.length;++S){let C=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.standLines[S]);if(C)return"standLines."+C}}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return c;let S=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(c.roomId!=null&&(S.roomId=String(c.roomId)),c.m3u8!=null&&(S.m3u8=String(c.m3u8)),c.rtmp!=null&&(S.rtmp=String(c.rtmp)),c.flv!=null&&(S.flv=String(c.flv)),c.rtmps!=null&&(S.rtmps=String(c.rtmps)),c.mainLine!=null){if(typeof c.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");S.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.mainLine)}if(c.standLines){if(!Array.isArray(c.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");S.standLines=[];for(let C=0;C<c.standLines.length;++C){if(typeof c.standLines[C]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");S.standLines[C]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.standLines[C])}}return S},b.toObject=function(c,S){S||(S={});let C={};if((S.arrays||S.defaults)&&(C.standLines=[]),S.defaults&&(C.roomId=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.m3u8!=null&&c.hasOwnProperty("m3u8")&&(C.m3u8=c.m3u8,S.oneofs&&(C._m3u8="m3u8")),c.rtmp!=null&&c.hasOwnProperty("rtmp")&&(C.rtmp=c.rtmp,S.oneofs&&(C._rtmp="rtmp")),c.flv!=null&&c.hasOwnProperty("flv")&&(C.flv=c.flv,S.oneofs&&(C._flv="flv")),c.rtmps!=null&&c.hasOwnProperty("rtmps")&&(C.rtmps=c.rtmps,S.oneofs&&(C._rtmps="rtmps")),c.mainLine!=null&&c.hasOwnProperty("mainLine")&&(C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.mainLine,S),S.oneofs&&(C._mainLine="mainLine")),c.standLines&&c.standLines.length){C.standLines=[];for(let M=0;M<c.standLines.length;++M)C.standLines[M]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.standLines[M],S)}return C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.CDNPlayAddressNotify"},b}(),D.UserChannel=function(){function b(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.userId="",b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let S=0;S<i.channels.length;++S)$root.com.quick.voice.proto.DataChannel.encode(i.channels[S],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.userId=i.string();break}case 2:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let S=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(S)return"channels."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let c=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(c.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");c.channels=[];for(let S=0;S<i.channels.length;++S){if(typeof i.channels[S]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");c.channels[S]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.channels=[]),c.defaults&&(S.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(S.userId=i.userId),i.channels&&i.channels.length){S.channels=[];for(let C=0;C<i.channels.length;++C)S.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},b}(),D.ChannelPublishReq=function(){function b(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let S=0;S<i.channels.length;++S)$root.com.quick.voice.proto.DataChannel.encode(i.channels[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let S=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(S)return"channels."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");c.channels=[];for(let S=0;S<i.channels.length;++S){if(typeof i.channels[S]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");c.channels[S]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.channels=[]),i.channels&&i.channels.length){S.channels=[];for(let C=0;C<i.channels.length;++C)S.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},b}(),D.ChannelPublishRsq=function(){function b(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let S=0;S<i.channels.length;++S)$root.com.quick.voice.proto.UserChannel.encode(i.channels[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let S=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(S)return"channels."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");c.channels=[];for(let S=0;S<i.channels.length;++S){if(typeof i.channels[S]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");c.channels[S]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.channels=[]),i.channels&&i.channels.length){S.channels=[];for(let C=0;C<i.channels.length;++C)S.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},b}(),D.ChannelSubscribeReq=function(){function b(k){if(this.users=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.users!=null&&i.users.length)for(let S=0;S<i.users.length;++S)$root.com.quick.voice.proto.UserChannel.encode(i.users[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let S=$root.com.quick.voice.proto.UserChannel.verify(i.users[c]);if(S)return"users."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");c.users=[];for(let S=0;S<i.users.length;++S){if(typeof i.users[S]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");c.users[S]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.users=[]),i.users&&i.users.length){S.users=[];for(let C=0;C<i.users.length;++C)S.users[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},b}(),D.ChannelSubscribeRsq=function(){function b(k){if(this.channels=[],k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let S=0;S<i.channels.length;++S)$root.com.quick.voice.proto.UserChannel.encode(i.channels[S],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let S=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(S)return"channels."+S}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");c.channels=[];for(let S=0;S<i.channels.length;++S){if(typeof i.channels[S]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");c.channels[S]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[S])}}return c},b.toObject=function(i,c){c||(c={});let S={};if((c.arrays||c.defaults)&&(S.channels=[]),i.channels&&i.channels.length){S.channels=[];for(let C=0;C<i.channels.length;++C)S.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},b}(),D.DataChannelData=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.userId="",b.prototype.type=0,b.prototype.audioData=null;let k;return Object.defineProperty(b.prototype,"_audioData",{get:$util.oneOfGetter(k=["audioData"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&S.uint32(10).string(c.userId),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&S.uint32(16).int32(c.type),c.audioData!=null&&Object.hasOwnProperty.call(c,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(c.audioData,S.uint32(26).fork()).ldelim(),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.DataChannelData;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.userId=c.string();break}case 2:{M.type=c.int32();break}case 3:{M.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(c,c.uint32());break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:break}if(c.audioData!=null&&c.hasOwnProperty("audioData")){let S=$root.com.quick.voice.proto.DataChannelAudioData.verify(c.audioData);if(S)return"audioData."+S}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelData)return c;let S=new $root.com.quick.voice.proto.DataChannelData;switch(c.userId!=null&&(S.userId=String(c.userId)),c.type){default:if(typeof c.type=="number"){S.type=c.type;break}break;case"backAuido":case 0:S.type=0;break}if(c.audioData!=null){if(typeof c.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");S.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(c.audioData)}return S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(C.userId="",C.type=S.enums===String?"backAuido":0),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId),c.type!=null&&c.hasOwnProperty("type")&&(C.type=S.enums===String?$root.com.quick.voice.proto.DataChannelType[c.type]===void 0?c.type:$root.com.quick.voice.proto.DataChannelType[c.type]:c.type),c.audioData!=null&&c.hasOwnProperty("audioData")&&(C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(c.audioData,S),S.oneofs&&(C._audioData="audioData")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelData"},b}(),D.DataChannelType=function(){const b={},k=Object.create(b);return k[b[0]="backAuido"]=0,k}(),D.DataChannelAudioData=function(){function b(i){if(i)for(let c=Object.keys(i),S=0;S<c.length;++S)i[c[S]]!=null&&(this[c[S]]=i[c[S]])}b.prototype.data=$util.newBuffer([]),b.prototype.format=null,b.prototype.time=null;let k;return Object.defineProperty(b.prototype,"_time",{get:$util.oneOfGetter(k=["time"]),set:$util.oneOfSetter(k)}),b.create=function(c){return new b(c)},b.encode=function(c,S){return S||(S=$Writer.create()),c.data!=null&&Object.hasOwnProperty.call(c,"data")&&S.uint32(10).bytes(c.data),c.format!=null&&Object.hasOwnProperty.call(c,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(c.format,S.uint32(18).fork()).ldelim(),c.time!=null&&Object.hasOwnProperty.call(c,"time")&&S.uint32(24).int64(c.time),S},b.encodeDelimited=function(c,S){return this.encode(c,S).ldelim()},b.decode=function(c,S){c instanceof $Reader||(c=$Reader.create(c));let C=S===void 0?c.len:c.pos+S,M=new $root.com.quick.voice.proto.DataChannelAudioData;for(;c.pos<C;){let Z=c.uint32();switch(Z>>>3){case 1:{M.data=c.bytes();break}case 2:{M.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(c,c.uint32());break}case 3:{M.time=c.int64();break}default:c.skipType(Z&7);break}}return M},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.data!=null&&c.hasOwnProperty("data")&&!(c.data&&typeof c.data.length=="number"||$util.isString(c.data)))return"data: buffer expected";if(c.format!=null&&c.hasOwnProperty("format")){let S=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(c.format);if(S)return"format."+S}return c.time!=null&&c.hasOwnProperty("time")&&!$util.isInteger(c.time)&&!(c.time&&$util.isInteger(c.time.low)&&$util.isInteger(c.time.high))?"time: integer|Long expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelAudioData)return c;let S=new $root.com.quick.voice.proto.DataChannelAudioData;if(c.data!=null&&(typeof c.data=="string"?$util.base64.decode(c.data,S.data=$util.newBuffer($util.base64.length(c.data)),0):c.data.length>=0&&(S.data=c.data)),c.format!=null){if(typeof c.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");S.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(c.format)}return c.time!=null&&($util.Long?(S.time=$util.Long.fromValue(c.time)).unsigned=!1:typeof c.time=="string"?S.time=parseInt(c.time,10):typeof c.time=="number"?S.time=c.time:typeof c.time=="object"&&(S.time=new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber())),S},b.toObject=function(c,S){S||(S={});let C={};return S.defaults&&(S.bytes===String?C.data="":(C.data=[],S.bytes!==Array&&(C.data=$util.newBuffer(C.data))),C.format=null),c.data!=null&&c.hasOwnProperty("data")&&(C.data=S.bytes===String?$util.base64.encode(c.data,0,c.data.length):S.bytes===Array?Array.prototype.slice.call(c.data):c.data),c.format!=null&&c.hasOwnProperty("format")&&(C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(c.format,S)),c.time!=null&&c.hasOwnProperty("time")&&(typeof c.time=="number"?C.time=S.longs===String?String(c.time):c.time:C.time=S.longs===String?$util.Long.prototype.toString.call(c.time):S.longs===Number?new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber():c.time,S.oneofs&&(C._time="time")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelAudioData"},b}(),D.DataChannelAudioFormat=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.sampleRate=0,b.prototype.channels=0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&c.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&c.uint32(16).int32(i.channels),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.sampleRate=i.double();break}case 2:{C.channels=i.int32();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&typeof i.sampleRate!="number"?"sampleRate: number expected":i.channels!=null&&i.hasOwnProperty("channels")&&!$util.isInteger(i.channels)?"channels: integer expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let c=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(c.sampleRate=Number(i.sampleRate)),i.channels!=null&&(c.channels=i.channels|0),c},b.toObject=function(i,c){c||(c={});let S={};return c.defaults&&(S.sampleRate=0,S.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&(S.sampleRate=c.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&(S.channels=i.channels),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},b}(),D.AckMsgReq=function(){function b(k){if(k)for(let i=Object.keys(k),c=0;c<i.length;++c)k[i[c]]!=null&&(this[i[c]]=k[i[c]])}return b.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&c.uint32(8).int64(i.msgId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let S=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<S;){let M=i.uint32();switch(M>>>3){case 1:{C.msgId=i.int64();break}default:i.skipType(M&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.msgId!=null&&i.hasOwnProperty("msgId")&&!$util.isInteger(i.msgId)&&!(i.msgId&&$util.isInteger(i.msgId.low)&&$util.isInteger(i.msgId.high))?"msgId: integer|Long expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let c=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(c.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?c.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?c.msgId=i.msgId:typeof i.msgId=="object"&&(c.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),c},b.toObject=function(i,c){c||(c={});let S={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);S.msgId=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else S.msgId=c.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?S.msgId=c.longs===String?String(i.msgId):i.msgId:S.msgId=c.longs===String?$util.Long.prototype.toString.call(i.msgId):c.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),S},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},b}(),D}(),$}(),N}(),O})(),enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",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(O){let N=O.length;for(;--N>=0;)O[N]=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(O,N,$,D,b){this.static_tree=O,this.extra_bits=N,this.extra_base=$,this.elems=D,this.max_length=b,this.has_stree=O&&O.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(O,N){this.dyn_tree=O,this.max_code=0,this.stat_desc=N}const d_code=O=>O<256?_dist_code[O]:_dist_code[256+(O>>>7)],put_short=(O,N)=>{O.pending_buf[O.pending++]=N&255,O.pending_buf[O.pending++]=N>>>8&255},send_bits=(O,N,$)=>{O.bi_valid>Buf_size-$?(O.bi_buf|=N<<O.bi_valid&65535,put_short(O,O.bi_buf),O.bi_buf=N>>Buf_size-O.bi_valid,O.bi_valid+=$-Buf_size):(O.bi_buf|=N<<O.bi_valid&65535,O.bi_valid+=$)},send_code=(O,N,$)=>{send_bits(O,$[N*2],$[N*2+1])},bi_reverse=(O,N)=>{let $=0;do $|=O&1,O>>>=1,$<<=1;while(--N>0);return $>>>1},bi_flush=O=>{O.bi_valid===16?(put_short(O,O.bi_buf),O.bi_buf=0,O.bi_valid=0):O.bi_valid>=8&&(O.pending_buf[O.pending++]=O.bi_buf&255,O.bi_buf>>=8,O.bi_valid-=8)},gen_bitlen=(O,N)=>{const $=N.dyn_tree,D=N.max_code,b=N.stat_desc.static_tree,k=N.stat_desc.has_stree,i=N.stat_desc.extra_bits,c=N.stat_desc.extra_base,S=N.stat_desc.max_length;let C,M,Z,J,z,Y,re=0;for(J=0;J<=MAX_BITS$1;J++)O.bl_count[J]=0;for($[O.heap[O.heap_max]*2+1]=0,C=O.heap_max+1;C<HEAP_SIZE$1;C++)M=O.heap[C],J=$[$[M*2+1]*2+1]+1,J>S&&(J=S,re++),$[M*2+1]=J,!(M>D)&&(O.bl_count[J]++,z=0,M>=c&&(z=i[M-c]),Y=$[M*2],O.opt_len+=Y*(J+z),k&&(O.static_len+=Y*(b[M*2+1]+z)));if(re!==0){do{for(J=S-1;O.bl_count[J]===0;)J--;O.bl_count[J]--,O.bl_count[J+1]+=2,O.bl_count[S]--,re-=2}while(re>0);for(J=S;J!==0;J--)for(M=O.bl_count[J];M!==0;)Z=O.heap[--C],!(Z>D)&&($[Z*2+1]!==J&&(O.opt_len+=(J-$[Z*2+1])*$[Z*2],$[Z*2+1]=J),M--)}},gen_codes=(O,N,$)=>{const D=new Array(MAX_BITS$1+1);let b=0,k,i;for(k=1;k<=MAX_BITS$1;k++)b=b+$[k-1]<<1,D[k]=b;for(i=0;i<=N;i++){let c=O[i*2+1];c!==0&&(O[i*2]=bi_reverse(D[c]++,c))}},tr_static_init=()=>{let O,N,$,D,b;const k=new Array(MAX_BITS$1+1);for($=0,D=0;D<LENGTH_CODES$1-1;D++)for(base_length[D]=$,O=0;O<1<<extra_lbits[D];O++)_length_code[$++]=D;for(_length_code[$-1]=D,b=0,D=0;D<16;D++)for(base_dist[D]=b,O=0;O<1<<extra_dbits[D];O++)_dist_code[b++]=D;for(b>>=7;D<D_CODES$1;D++)for(base_dist[D]=b<<7,O=0;O<1<<extra_dbits[D]-7;O++)_dist_code[256+b++]=D;for(N=0;N<=MAX_BITS$1;N++)k[N]=0;for(O=0;O<=143;)static_ltree[O*2+1]=8,O++,k[8]++;for(;O<=255;)static_ltree[O*2+1]=9,O++,k[9]++;for(;O<=279;)static_ltree[O*2+1]=7,O++,k[7]++;for(;O<=287;)static_ltree[O*2+1]=8,O++,k[8]++;for(gen_codes(static_ltree,L_CODES$1+1,k),O=0;O<D_CODES$1;O++)static_dtree[O*2+1]=5,static_dtree[O*2]=bi_reverse(O,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=O=>{let N;for(N=0;N<L_CODES$1;N++)O.dyn_ltree[N*2]=0;for(N=0;N<D_CODES$1;N++)O.dyn_dtree[N*2]=0;for(N=0;N<BL_CODES$1;N++)O.bl_tree[N*2]=0;O.dyn_ltree[END_BLOCK*2]=1,O.opt_len=O.static_len=0,O.sym_next=O.matches=0},bi_windup=O=>{O.bi_valid>8?put_short(O,O.bi_buf):O.bi_valid>0&&(O.pending_buf[O.pending++]=O.bi_buf),O.bi_buf=0,O.bi_valid=0},smaller=(O,N,$,D)=>{const b=N*2,k=$*2;return O[b]<O[k]||O[b]===O[k]&&D[N]<=D[$]},pqdownheap=(O,N,$)=>{const D=O.heap[$];let b=$<<1;for(;b<=O.heap_len&&(b<O.heap_len&&smaller(N,O.heap[b+1],O.heap[b],O.depth)&&b++,!smaller(N,D,O.heap[b],O.depth));)O.heap[$]=O.heap[b],$=b,b<<=1;O.heap[$]=D},compress_block=(O,N,$)=>{let D,b,k=0,i,c;if(O.sym_next!==0)do D=O.pending_buf[O.sym_buf+k++]&255,D+=(O.pending_buf[O.sym_buf+k++]&255)<<8,b=O.pending_buf[O.sym_buf+k++],D===0?send_code(O,b,N):(i=_length_code[b],send_code(O,i+LITERALS$1+1,N),c=extra_lbits[i],c!==0&&(b-=base_length[i],send_bits(O,b,c)),D--,i=d_code(D),send_code(O,i,$),c=extra_dbits[i],c!==0&&(D-=base_dist[i],send_bits(O,D,c)));while(k<O.sym_next);send_code(O,END_BLOCK,N)},build_tree=(O,N)=>{const $=N.dyn_tree,D=N.stat_desc.static_tree,b=N.stat_desc.has_stree,k=N.stat_desc.elems;let i,c,S=-1,C;for(O.heap_len=0,O.heap_max=HEAP_SIZE$1,i=0;i<k;i++)$[i*2]!==0?(O.heap[++O.heap_len]=S=i,O.depth[i]=0):$[i*2+1]=0;for(;O.heap_len<2;)C=O.heap[++O.heap_len]=S<2?++S:0,$[C*2]=1,O.depth[C]=0,O.opt_len--,b&&(O.static_len-=D[C*2+1]);for(N.max_code=S,i=O.heap_len>>1;i>=1;i--)pqdownheap(O,$,i);C=k;do i=O.heap[1],O.heap[1]=O.heap[O.heap_len--],pqdownheap(O,$,1),c=O.heap[1],O.heap[--O.heap_max]=i,O.heap[--O.heap_max]=c,$[C*2]=$[i*2]+$[c*2],O.depth[C]=(O.depth[i]>=O.depth[c]?O.depth[i]:O.depth[c])+1,$[i*2+1]=$[c*2+1]=C,O.heap[1]=C++,pqdownheap(O,$,1);while(O.heap_len>=2);O.heap[--O.heap_max]=O.heap[1],gen_bitlen(O,N),gen_codes($,S,O.bl_count)},scan_tree=(O,N,$)=>{let D,b=-1,k,i=N[1],c=0,S=7,C=4;for(i===0&&(S=138,C=3),N[($+1)*2+1]=65535,D=0;D<=$;D++)k=i,i=N[(D+1)*2+1],!(++c<S&&k===i)&&(c<C?O.bl_tree[k*2]+=c:k!==0?(k!==b&&O.bl_tree[k*2]++,O.bl_tree[REP_3_6*2]++):c<=10?O.bl_tree[REPZ_3_10*2]++:O.bl_tree[REPZ_11_138*2]++,c=0,b=k,i===0?(S=138,C=3):k===i?(S=6,C=3):(S=7,C=4))},send_tree=(O,N,$)=>{let D,b=-1,k,i=N[1],c=0,S=7,C=4;for(i===0&&(S=138,C=3),D=0;D<=$;D++)if(k=i,i=N[(D+1)*2+1],!(++c<S&&k===i)){if(c<C)do send_code(O,k,O.bl_tree);while(--c!==0);else k!==0?(k!==b&&(send_code(O,k,O.bl_tree),c--),send_code(O,REP_3_6,O.bl_tree),send_bits(O,c-3,2)):c<=10?(send_code(O,REPZ_3_10,O.bl_tree),send_bits(O,c-3,3)):(send_code(O,REPZ_11_138,O.bl_tree),send_bits(O,c-11,7));c=0,b=k,i===0?(S=138,C=3):k===i?(S=6,C=3):(S=7,C=4)}},build_bl_tree=O=>{let N;for(scan_tree(O,O.dyn_ltree,O.l_desc.max_code),scan_tree(O,O.dyn_dtree,O.d_desc.max_code),build_tree(O,O.bl_desc),N=BL_CODES$1-1;N>=3&&O.bl_tree[bl_order[N]*2+1]===0;N--);return O.opt_len+=3*(N+1)+5+5+4,N},send_all_trees=(O,N,$,D)=>{let b;for(send_bits(O,N-257,5),send_bits(O,$-1,5),send_bits(O,D-4,4),b=0;b<D;b++)send_bits(O,O.bl_tree[bl_order[b]*2+1],3);send_tree(O,O.dyn_ltree,N-1),send_tree(O,O.dyn_dtree,$-1)},detect_data_type=O=>{let N=4093624447,$;for($=0;$<=31;$++,N>>>=1)if(N&1&&O.dyn_ltree[$*2]!==0)return Z_BINARY;if(O.dyn_ltree[18]!==0||O.dyn_ltree[20]!==0||O.dyn_ltree[26]!==0)return Z_TEXT;for($=32;$<LITERALS$1;$++)if(O.dyn_ltree[$*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=O=>{static_init_done||(tr_static_init(),static_init_done=!0),O.l_desc=new TreeDesc(O.dyn_ltree,static_l_desc),O.d_desc=new TreeDesc(O.dyn_dtree,static_d_desc),O.bl_desc=new TreeDesc(O.bl_tree,static_bl_desc),O.bi_buf=0,O.bi_valid=0,init_block(O)},_tr_stored_block$1=(O,N,$,D)=>{send_bits(O,(STORED_BLOCK<<1)+(D?1:0),3),bi_windup(O),put_short(O,$),put_short(O,~$),$&&O.pending_buf.set(O.window.subarray(N,N+$),O.pending),O.pending+=$},_tr_align$1=O=>{send_bits(O,STATIC_TREES<<1,3),send_code(O,END_BLOCK,static_ltree),bi_flush(O)},_tr_flush_block$1=(O,N,$,D)=>{let b,k,i=0;O.level>0?(O.strm.data_type===Z_UNKNOWN$1&&(O.strm.data_type=detect_data_type(O)),build_tree(O,O.l_desc),build_tree(O,O.d_desc),i=build_bl_tree(O),b=O.opt_len+3+7>>>3,k=O.static_len+3+7>>>3,k<=b&&(b=k)):b=k=$+5,$+4<=b&&N!==-1?_tr_stored_block$1(O,N,$,D):O.strategy===Z_FIXED$1||k===b?(send_bits(O,(STATIC_TREES<<1)+(D?1:0),3),compress_block(O,static_ltree,static_dtree)):(send_bits(O,(DYN_TREES<<1)+(D?1:0),3),send_all_trees(O,O.l_desc.max_code+1,O.d_desc.max_code+1,i+1),compress_block(O,O.dyn_ltree,O.dyn_dtree)),init_block(O),D&&bi_windup(O)},_tr_tally$1=(O,N,$)=>(O.pending_buf[O.sym_buf+O.sym_next++]=N,O.pending_buf[O.sym_buf+O.sym_next++]=N>>8,O.pending_buf[O.sym_buf+O.sym_next++]=$,N===0?O.dyn_ltree[$*2]++:(O.matches++,N--,O.dyn_ltree[(_length_code[$]+LITERALS$1+1)*2]++,O.dyn_dtree[d_code(N)*2]++),O.sym_next===O.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=(O,N,$,D)=>{let b=O&65535|0,k=O>>>16&65535|0,i=0;for(;$!==0;){i=$>2e3?2e3:$,$-=i;do b=b+N[D++]|0,k=k+b|0;while(--i);b%=65521,k%=65521}return b|k<<16|0};var adler32_1=adler32;const makeTable=()=>{let O,N=[];for(var $=0;$<256;$++){O=$;for(var D=0;D<8;D++)O=O&1?3988292384^O>>>1:O>>>1;N[$]=O}return N},crcTable=new Uint32Array(makeTable()),crc32=(O,N,$,D)=>{const b=crcTable,k=D+$;O^=-1;for(let i=D;i<k;i++)O=O>>>8^b[(O^N[i])&255];return O^-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=(O,N)=>(O.msg=messages[N],N),rank=O=>O*2-(O>4?9:0),zero=O=>{let N=O.length;for(;--N>=0;)O[N]=0},slide_hash=O=>{let N,$,D,b=O.w_size;N=O.hash_size,D=N;do $=O.head[--D],O.head[D]=$>=b?$-b:0;while(--N);N=b,D=N;do $=O.prev[--D],O.prev[D]=$>=b?$-b:0;while(--N)};let HASH_ZLIB=(O,N,$)=>(N<<O.hash_shift^$)&O.hash_mask,HASH=HASH_ZLIB;const flush_pending=O=>{const N=O.state;let $=N.pending;$>O.avail_out&&($=O.avail_out),$!==0&&(O.output.set(N.pending_buf.subarray(N.pending_out,N.pending_out+$),O.next_out),O.next_out+=$,N.pending_out+=$,O.total_out+=$,O.avail_out-=$,N.pending-=$,N.pending===0&&(N.pending_out=0))},flush_block_only=(O,N)=>{_tr_flush_block(O,O.block_start>=0?O.block_start:-1,O.strstart-O.block_start,N),O.block_start=O.strstart,flush_pending(O.strm)},put_byte=(O,N)=>{O.pending_buf[O.pending++]=N},putShortMSB=(O,N)=>{O.pending_buf[O.pending++]=N>>>8&255,O.pending_buf[O.pending++]=N&255},read_buf=(O,N,$,D)=>{let b=O.avail_in;return b>D&&(b=D),b===0?0:(O.avail_in-=b,N.set(O.input.subarray(O.next_in,O.next_in+b),$),O.state.wrap===1?O.adler=adler32_1(O.adler,N,b,$):O.state.wrap===2&&(O.adler=crc32_1(O.adler,N,b,$)),O.next_in+=b,O.total_in+=b,b)},longest_match=(O,N)=>{let $=O.max_chain_length,D=O.strstart,b,k,i=O.prev_length,c=O.nice_match;const S=O.strstart>O.w_size-MIN_LOOKAHEAD?O.strstart-(O.w_size-MIN_LOOKAHEAD):0,C=O.window,M=O.w_mask,Z=O.prev,J=O.strstart+MAX_MATCH;let z=C[D+i-1],Y=C[D+i];O.prev_length>=O.good_match&&($>>=2),c>O.lookahead&&(c=O.lookahead);do if(b=N,!(C[b+i]!==Y||C[b+i-1]!==z||C[b]!==C[D]||C[++b]!==C[D+1])){D+=2,b++;do;while(C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&C[++D]===C[++b]&&D<J);if(k=MAX_MATCH-(J-D),D=J-MAX_MATCH,k>i){if(O.match_start=N,i=k,k>=c)break;z=C[D+i-1],Y=C[D+i]}}while((N=Z[N&M])>S&&--$!==0);return i<=O.lookahead?i:O.lookahead},fill_window=O=>{const N=O.w_size;let $,D,b;do{if(D=O.window_size-O.lookahead-O.strstart,O.strstart>=N+(N-MIN_LOOKAHEAD)&&(O.window.set(O.window.subarray(N,N+N-D),0),O.match_start-=N,O.strstart-=N,O.block_start-=N,O.insert>O.strstart&&(O.insert=O.strstart),slide_hash(O),D+=N),O.strm.avail_in===0)break;if($=read_buf(O.strm,O.window,O.strstart+O.lookahead,D),O.lookahead+=$,O.lookahead+O.insert>=MIN_MATCH)for(b=O.strstart-O.insert,O.ins_h=O.window[b],O.ins_h=HASH(O,O.ins_h,O.window[b+1]);O.insert&&(O.ins_h=HASH(O,O.ins_h,O.window[b+MIN_MATCH-1]),O.prev[b&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=b,b++,O.insert--,!(O.lookahead+O.insert<MIN_MATCH)););}while(O.lookahead<MIN_LOOKAHEAD&&O.strm.avail_in!==0)},deflate_stored=(O,N)=>{let $=O.pending_buf_size-5>O.w_size?O.w_size:O.pending_buf_size-5,D,b,k,i=0,c=O.strm.avail_in;do{if(D=65535,k=O.bi_valid+42>>3,O.strm.avail_out<k||(k=O.strm.avail_out-k,b=O.strstart-O.block_start,D>b+O.strm.avail_in&&(D=b+O.strm.avail_in),D>k&&(D=k),D<$&&(D===0&&N!==Z_FINISH$3||N===Z_NO_FLUSH$2||D!==b+O.strm.avail_in)))break;i=N===Z_FINISH$3&&D===b+O.strm.avail_in?1:0,_tr_stored_block(O,0,0,i),O.pending_buf[O.pending-4]=D,O.pending_buf[O.pending-3]=D>>8,O.pending_buf[O.pending-2]=~D,O.pending_buf[O.pending-1]=~D>>8,flush_pending(O.strm),b&&(b>D&&(b=D),O.strm.output.set(O.window.subarray(O.block_start,O.block_start+b),O.strm.next_out),O.strm.next_out+=b,O.strm.avail_out-=b,O.strm.total_out+=b,O.block_start+=b,D-=b),D&&(read_buf(O.strm,O.strm.output,O.strm.next_out,D),O.strm.next_out+=D,O.strm.avail_out-=D,O.strm.total_out+=D)}while(i===0);return c-=O.strm.avail_in,c&&(c>=O.w_size?(O.matches=2,O.window.set(O.strm.input.subarray(O.strm.next_in-O.w_size,O.strm.next_in),0),O.strstart=O.w_size,O.insert=O.strstart):(O.window_size-O.strstart<=c&&(O.strstart-=O.w_size,O.window.set(O.window.subarray(O.w_size,O.w_size+O.strstart),0),O.matches<2&&O.matches++,O.insert>O.strstart&&(O.insert=O.strstart)),O.window.set(O.strm.input.subarray(O.strm.next_in-c,O.strm.next_in),O.strstart),O.strstart+=c,O.insert+=c>O.w_size-O.insert?O.w_size-O.insert:c),O.block_start=O.strstart),O.high_water<O.strstart&&(O.high_water=O.strstart),i?BS_FINISH_DONE:N!==Z_NO_FLUSH$2&&N!==Z_FINISH$3&&O.strm.avail_in===0&&O.strstart===O.block_start?BS_BLOCK_DONE:(k=O.window_size-O.strstart,O.strm.avail_in>k&&O.block_start>=O.w_size&&(O.block_start-=O.w_size,O.strstart-=O.w_size,O.window.set(O.window.subarray(O.w_size,O.w_size+O.strstart),0),O.matches<2&&O.matches++,k+=O.w_size,O.insert>O.strstart&&(O.insert=O.strstart)),k>O.strm.avail_in&&(k=O.strm.avail_in),k&&(read_buf(O.strm,O.window,O.strstart,k),O.strstart+=k,O.insert+=k>O.w_size-O.insert?O.w_size-O.insert:k),O.high_water<O.strstart&&(O.high_water=O.strstart),k=O.bi_valid+42>>3,k=O.pending_buf_size-k>65535?65535:O.pending_buf_size-k,$=k>O.w_size?O.w_size:k,b=O.strstart-O.block_start,(b>=$||(b||N===Z_FINISH$3)&&N!==Z_NO_FLUSH$2&&O.strm.avail_in===0&&b<=k)&&(D=b>k?k:b,i=N===Z_FINISH$3&&O.strm.avail_in===0&&D===b?1:0,_tr_stored_block(O,O.block_start,D,i),O.block_start+=D,flush_pending(O.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(O,N)=>{let $,D;for(;;){if(O.lookahead<MIN_LOOKAHEAD){if(fill_window(O),O.lookahead<MIN_LOOKAHEAD&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if($=0,O.lookahead>=MIN_MATCH&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),$=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),$!==0&&O.strstart-$<=O.w_size-MIN_LOOKAHEAD&&(O.match_length=longest_match(O,$)),O.match_length>=MIN_MATCH)if(D=_tr_tally(O,O.strstart-O.match_start,O.match_length-MIN_MATCH),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=MIN_MATCH){O.match_length--;do O.strstart++,O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),$=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart;while(--O.match_length!==0);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+1]);else D=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(D&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=O.strstart<MIN_MATCH-1?O.strstart:MIN_MATCH-1,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(O,N)=>{let $,D,b;for(;;){if(O.lookahead<MIN_LOOKAHEAD){if(fill_window(O),O.lookahead<MIN_LOOKAHEAD&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if($=0,O.lookahead>=MIN_MATCH&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),$=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=MIN_MATCH-1,$!==0&&O.prev_length<O.max_lazy_match&&O.strstart-$<=O.w_size-MIN_LOOKAHEAD&&(O.match_length=longest_match(O,$),O.match_length<=5&&(O.strategy===Z_FILTERED||O.match_length===MIN_MATCH&&O.strstart-O.match_start>4096)&&(O.match_length=MIN_MATCH-1)),O.prev_length>=MIN_MATCH&&O.match_length<=O.prev_length){b=O.strstart+O.lookahead-MIN_MATCH,D=_tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-MIN_MATCH),O.lookahead-=O.prev_length-1,O.prev_length-=2;do++O.strstart<=b&&(O.ins_h=HASH(O,O.ins_h,O.window[O.strstart+MIN_MATCH-1]),$=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart);while(--O.prev_length!==0);if(O.match_available=0,O.match_length=MIN_MATCH-1,O.strstart++,D&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}else if(O.match_available){if(D=_tr_tally(O,0,O.window[O.strstart-1]),D&&flush_block_only(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return BS_NEED_MORE}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(D=_tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<MIN_MATCH-1?O.strstart:MIN_MATCH-1,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(O,N)=>{let $,D,b,k;const i=O.window;for(;;){if(O.lookahead<=MAX_MATCH){if(fill_window(O),O.lookahead<=MAX_MATCH&&N===Z_NO_FLUSH$2)return BS_NEED_MORE;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=MIN_MATCH&&O.strstart>0&&(b=O.strstart-1,D=i[b],D===i[++b]&&D===i[++b]&&D===i[++b])){k=O.strstart+MAX_MATCH;do;while(D===i[++b]&&D===i[++b]&&D===i[++b]&&D===i[++b]&&D===i[++b]&&D===i[++b]&&D===i[++b]&&D===i[++b]&&b<k);O.match_length=MAX_MATCH-(k-b),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=MIN_MATCH?($=_tr_tally(O,1,O.match_length-MIN_MATCH),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):($=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),$&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=0,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(O,N)=>{let $;for(;;){if(O.lookahead===0&&(fill_window(O),O.lookahead===0)){if(N===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(O.match_length=0,$=_tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,$&&(flush_block_only(O,!1),O.strm.avail_out===0))return BS_NEED_MORE}return O.insert=0,N===Z_FINISH$3?(flush_block_only(O,!0),O.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):O.sym_next&&(flush_block_only(O,!1),O.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(O,N,$,D,b){this.good_length=O,this.max_lazy=N,this.nice_length=$,this.max_chain=D,this.func=b}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=O=>{O.window_size=2*O.w_size,zero(O.head),O.max_lazy_match=configuration_table[O.level].max_lazy,O.good_match=configuration_table[O.level].good_length,O.nice_match=configuration_table[O.level].nice_length,O.max_chain_length=configuration_table[O.level].max_chain,O.strstart=0,O.block_start=0,O.lookahead=0,O.insert=0,O.match_length=O.prev_length=MIN_MATCH-1,O.match_available=0,O.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=O=>{if(!O)return 1;const N=O.state;return!N||N.strm!==O||N.status!==INIT_STATE&&N.status!==GZIP_STATE&&N.status!==EXTRA_STATE&&N.status!==NAME_STATE&&N.status!==COMMENT_STATE&&N.status!==HCRC_STATE&&N.status!==BUSY_STATE&&N.status!==FINISH_STATE?1:0},deflateResetKeep=O=>{if(deflateStateCheck(O))return err(O,Z_STREAM_ERROR$2);O.total_in=O.total_out=0,O.data_type=Z_UNKNOWN;const N=O.state;return N.pending=0,N.pending_out=0,N.wrap<0&&(N.wrap=-N.wrap),N.status=N.wrap===2?GZIP_STATE:N.wrap?INIT_STATE:BUSY_STATE,O.adler=N.wrap===2?0:1,N.last_flush=-2,_tr_init(N),Z_OK$3},deflateReset=O=>{const N=deflateResetKeep(O);return N===Z_OK$3&&lm_init(O.state),N},deflateSetHeader=(O,N)=>deflateStateCheck(O)||O.state.wrap!==2?Z_STREAM_ERROR$2:(O.state.gzhead=N,Z_OK$3),deflateInit2=(O,N,$,D,b,k)=>{if(!O)return Z_STREAM_ERROR$2;let i=1;if(N===Z_DEFAULT_COMPRESSION$1&&(N=6),D<0?(i=0,D=-D):D>15&&(i=2,D-=16),b<1||b>MAX_MEM_LEVEL||$!==Z_DEFLATED$2||D<8||D>15||N<0||N>9||k<0||k>Z_FIXED||D===8&&i!==1)return err(O,Z_STREAM_ERROR$2);D===8&&(D=9);const c=new DeflateState;return O.state=c,c.strm=O,c.status=INIT_STATE,c.wrap=i,c.gzhead=null,c.w_bits=D,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=b+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+MIN_MATCH-1)/MIN_MATCH),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<b+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=N,c.strategy=k,c.method=$,deflateReset(O)},deflateInit=(O,N)=>deflateInit2(O,N,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(O,N)=>{if(deflateStateCheck(O)||N>Z_BLOCK$1||N<0)return O?err(O,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const $=O.state;if(!O.output||O.avail_in!==0&&!O.input||$.status===FINISH_STATE&&N!==Z_FINISH$3)return err(O,O.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const D=$.last_flush;if($.last_flush=N,$.pending!==0){if(flush_pending(O),O.avail_out===0)return $.last_flush=-1,Z_OK$3}else if(O.avail_in===0&&rank(N)<=rank(D)&&N!==Z_FINISH$3)return err(O,Z_BUF_ERROR$1);if($.status===FINISH_STATE&&O.avail_in!==0)return err(O,Z_BUF_ERROR$1);if($.status===INIT_STATE&&$.wrap===0&&($.status=BUSY_STATE),$.status===INIT_STATE){let b=Z_DEFLATED$2+($.w_bits-8<<4)<<8,k=-1;if($.strategy>=Z_HUFFMAN_ONLY||$.level<2?k=0:$.level<6?k=1:$.level===6?k=2:k=3,b|=k<<6,$.strstart!==0&&(b|=PRESET_DICT),b+=31-b%31,putShortMSB($,b),$.strstart!==0&&(putShortMSB($,O.adler>>>16),putShortMSB($,O.adler&65535)),O.adler=1,$.status=BUSY_STATE,flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3}if($.status===GZIP_STATE){if(O.adler=0,put_byte($,31),put_byte($,139),put_byte($,8),$.gzhead)put_byte($,($.gzhead.text?1:0)+($.gzhead.hcrc?2:0)+($.gzhead.extra?4:0)+($.gzhead.name?8:0)+($.gzhead.comment?16:0)),put_byte($,$.gzhead.time&255),put_byte($,$.gzhead.time>>8&255),put_byte($,$.gzhead.time>>16&255),put_byte($,$.gzhead.time>>24&255),put_byte($,$.level===9?2:$.strategy>=Z_HUFFMAN_ONLY||$.level<2?4:0),put_byte($,$.gzhead.os&255),$.gzhead.extra&&$.gzhead.extra.length&&(put_byte($,$.gzhead.extra.length&255),put_byte($,$.gzhead.extra.length>>8&255)),$.gzhead.hcrc&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending,0)),$.gzindex=0,$.status=EXTRA_STATE;else if(put_byte($,0),put_byte($,0),put_byte($,0),put_byte($,0),put_byte($,0),put_byte($,$.level===9?2:$.strategy>=Z_HUFFMAN_ONLY||$.level<2?4:0),put_byte($,OS_CODE),$.status=BUSY_STATE,flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3}if($.status===EXTRA_STATE){if($.gzhead.extra){let b=$.pending,k=($.gzhead.extra.length&65535)-$.gzindex;for(;$.pending+k>$.pending_buf_size;){let c=$.pending_buf_size-$.pending;if($.pending_buf.set($.gzhead.extra.subarray($.gzindex,$.gzindex+c),$.pending),$.pending=$.pending_buf_size,$.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b)),$.gzindex+=c,flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3;b=0,k-=c}let i=new Uint8Array($.gzhead.extra);$.pending_buf.set(i.subarray($.gzindex,$.gzindex+k),$.pending),$.pending+=k,$.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b)),$.gzindex=0}$.status=NAME_STATE}if($.status===NAME_STATE){if($.gzhead.name){let b=$.pending,k;do{if($.pending===$.pending_buf_size){if($.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b)),flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3;b=0}$.gzindex<$.gzhead.name.length?k=$.gzhead.name.charCodeAt($.gzindex++)&255:k=0,put_byte($,k)}while(k!==0);$.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b)),$.gzindex=0}$.status=COMMENT_STATE}if($.status===COMMENT_STATE){if($.gzhead.comment){let b=$.pending,k;do{if($.pending===$.pending_buf_size){if($.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b)),flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3;b=0}$.gzindex<$.gzhead.comment.length?k=$.gzhead.comment.charCodeAt($.gzindex++)&255:k=0,put_byte($,k)}while(k!==0);$.gzhead.hcrc&&$.pending>b&&(O.adler=crc32_1(O.adler,$.pending_buf,$.pending-b,b))}$.status=HCRC_STATE}if($.status===HCRC_STATE){if($.gzhead.hcrc){if($.pending+2>$.pending_buf_size&&(flush_pending(O),$.pending!==0))return $.last_flush=-1,Z_OK$3;put_byte($,O.adler&255),put_byte($,O.adler>>8&255),O.adler=0}if($.status=BUSY_STATE,flush_pending(O),$.pending!==0)return $.last_flush=-1,Z_OK$3}if(O.avail_in!==0||$.lookahead!==0||N!==Z_NO_FLUSH$2&&$.status!==FINISH_STATE){let b=$.level===0?deflate_stored($,N):$.strategy===Z_HUFFMAN_ONLY?deflate_huff($,N):$.strategy===Z_RLE?deflate_rle($,N):configuration_table[$.level].func($,N);if((b===BS_FINISH_STARTED||b===BS_FINISH_DONE)&&($.status=FINISH_STATE),b===BS_NEED_MORE||b===BS_FINISH_STARTED)return O.avail_out===0&&($.last_flush=-1),Z_OK$3;if(b===BS_BLOCK_DONE&&(N===Z_PARTIAL_FLUSH?_tr_align($):N!==Z_BLOCK$1&&(_tr_stored_block($,0,0,!1),N===Z_FULL_FLUSH$1&&(zero($.head),$.lookahead===0&&($.strstart=0,$.block_start=0,$.insert=0))),flush_pending(O),O.avail_out===0))return $.last_flush=-1,Z_OK$3}return N!==Z_FINISH$3?Z_OK$3:$.wrap<=0?Z_STREAM_END$3:($.wrap===2?(put_byte($,O.adler&255),put_byte($,O.adler>>8&255),put_byte($,O.adler>>16&255),put_byte($,O.adler>>24&255),put_byte($,O.total_in&255),put_byte($,O.total_in>>8&255),put_byte($,O.total_in>>16&255),put_byte($,O.total_in>>24&255)):(putShortMSB($,O.adler>>>16),putShortMSB($,O.adler&65535)),flush_pending(O),$.wrap>0&&($.wrap=-$.wrap),$.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=O=>{if(deflateStateCheck(O))return Z_STREAM_ERROR$2;const N=O.state.status;return O.state=null,N===BUSY_STATE?err(O,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(O,N)=>{let $=N.length;if(deflateStateCheck(O))return Z_STREAM_ERROR$2;const D=O.state,b=D.wrap;if(b===2||b===1&&D.status!==INIT_STATE||D.lookahead)return Z_STREAM_ERROR$2;if(b===1&&(O.adler=adler32_1(O.adler,N,$,0)),D.wrap=0,$>=D.w_size){b===0&&(zero(D.head),D.strstart=0,D.block_start=0,D.insert=0);let S=new Uint8Array(D.w_size);S.set(N.subarray($-D.w_size,$),0),N=S,$=D.w_size}const k=O.avail_in,i=O.next_in,c=O.input;for(O.avail_in=$,O.next_in=0,O.input=N,fill_window(D);D.lookahead>=MIN_MATCH;){let S=D.strstart,C=D.lookahead-(MIN_MATCH-1);do D.ins_h=HASH(D,D.ins_h,D.window[S+MIN_MATCH-1]),D.prev[S&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=S,S++;while(--C);D.strstart=S,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,O.next_in=i,O.input=c,O.avail_in=k,D.wrap=b,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=(O,N)=>Object.prototype.hasOwnProperty.call(O,N);var assign=function(O){const N=Array.prototype.slice.call(arguments,1);for(;N.length;){const $=N.shift();if($){if(typeof $!="object")throw new TypeError($+"must be non-object");for(const D in $)_has($,D)&&(O[D]=$[D])}}return O},flattenChunks=O=>{let N=0;for(let D=0,b=O.length;D<b;D++)N+=O[D].length;const $=new Uint8Array(N);for(let D=0,b=0,k=O.length;D<k;D++){let i=O[D];$.set(i,b),b+=i.length}return $},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(O){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let O=0;O<256;O++)_utf8len[O]=O>=252?6:O>=248?5:O>=240?4:O>=224?3:O>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=O=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(O);let N,$,D,b,k,i=O.length,c=0;for(b=0;b<i;b++)$=O.charCodeAt(b),($&64512)===55296&&b+1<i&&(D=O.charCodeAt(b+1),(D&64512)===56320&&($=65536+($-55296<<10)+(D-56320),b++)),c+=$<128?1:$<2048?2:$<65536?3:4;for(N=new Uint8Array(c),k=0,b=0;k<c;b++)$=O.charCodeAt(b),($&64512)===55296&&b+1<i&&(D=O.charCodeAt(b+1),(D&64512)===56320&&($=65536+($-55296<<10)+(D-56320),b++)),$<128?N[k++]=$:$<2048?(N[k++]=192|$>>>6,N[k++]=128|$&63):$<65536?(N[k++]=224|$>>>12,N[k++]=128|$>>>6&63,N[k++]=128|$&63):(N[k++]=240|$>>>18,N[k++]=128|$>>>12&63,N[k++]=128|$>>>6&63,N[k++]=128|$&63);return N};const buf2binstring=(O,N)=>{if(N<65534&&O.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,O.length===N?O:O.subarray(0,N));let $="";for(let D=0;D<N;D++)$+=String.fromCharCode(O[D]);return $};var buf2string=(O,N)=>{const $=N||O.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(O.subarray(0,N));let D,b;const k=new Array($*2);for(b=0,D=0;D<$;){let i=O[D++];if(i<128){k[b++]=i;continue}let c=_utf8len[i];if(c>4){k[b++]=65533,D+=c-1;continue}for(i&=c===2?31:c===3?15:7;c>1&&D<$;)i=i<<6|O[D++]&63,c--;if(c>1){k[b++]=65533;continue}i<65536?k[b++]=i:(i-=65536,k[b++]=55296|i>>10&1023,k[b++]=56320|i&1023)}return buf2binstring(k,b)},utf8border=(O,N)=>{N=N||O.length,N>O.length&&(N=O.length);let $=N-1;for(;$>=0&&(O[$]&192)===128;)$--;return $<0||$===0?N:$+_utf8len[O[$]]>N?$:N},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(O){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},O||{});let N=this.options;N.raw&&N.windowBits>0?N.windowBits=-N.windowBits:N.gzip&&N.windowBits>0&&N.windowBits<16&&(N.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let $=deflate_1$2.deflateInit2(this.strm,N.level,N.method,N.windowBits,N.memLevel,N.strategy);if($!==Z_OK$2)throw new Error(messages[$]);if(N.header&&deflate_1$2.deflateSetHeader(this.strm,N.header),N.dictionary){let D;if(typeof N.dictionary=="string"?D=strings.string2buf(N.dictionary):toString$1.call(N.dictionary)==="[object ArrayBuffer]"?D=new Uint8Array(N.dictionary):D=N.dictionary,$=deflate_1$2.deflateSetDictionary(this.strm,D),$!==Z_OK$2)throw new Error(messages[$]);this._dict_set=!0}}Deflate$1.prototype.push=function(O,N){const $=this.strm,D=this.options.chunkSize;let b,k;if(this.ended)return!1;for(N===~~N?k=N:k=N===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof O=="string"?$.input=strings.string2buf(O):toString$1.call(O)==="[object ArrayBuffer]"?$.input=new Uint8Array(O):$.input=O,$.next_in=0,$.avail_in=$.input.length;;){if($.avail_out===0&&($.output=new Uint8Array(D),$.next_out=0,$.avail_out=D),(k===Z_SYNC_FLUSH||k===Z_FULL_FLUSH)&&$.avail_out<=6){this.onData($.output.subarray(0,$.next_out)),$.avail_out=0;continue}if(b=deflate_1$2.deflate($,k),b===Z_STREAM_END$2)return $.next_out>0&&this.onData($.output.subarray(0,$.next_out)),b=deflate_1$2.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===Z_OK$2;if($.avail_out===0){this.onData($.output);continue}if(k>0&&$.next_out>0){this.onData($.output.subarray(0,$.next_out)),$.avail_out=0;continue}if($.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(O){this.chunks.push(O)},Deflate$1.prototype.onEnd=function(O){O===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=O,this.msg=this.strm.msg};function deflate$1(O,N){const $=new Deflate$1(N);if($.push(O,!0),$.err)throw $.msg||messages[$.err];return $.result}function deflateRaw$1(O,N){return N=N||{},N.raw=!0,deflate$1(O,N)}function gzip$1(O,N){return N=N||{},N.gzip=!0,deflate$1(O,N)}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 O(N,$){let D,b,k,i,c,S,C,M,Z,J,z,Y,re,oe,ie,de,ye,Q,ae,he,ce,fe,me,ee;const le=N.state;D=N.next_in,me=N.input,b=D+(N.avail_in-5),k=N.next_out,ee=N.output,i=k-($-N.avail_out),c=k+(N.avail_out-257),S=le.dmax,C=le.wsize,M=le.whave,Z=le.wnext,J=le.window,z=le.hold,Y=le.bits,re=le.lencode,oe=le.distcode,ie=(1<<le.lenbits)-1,de=(1<<le.distbits)-1;e:do{Y<15&&(z+=me[D++]<<Y,Y+=8,z+=me[D++]<<Y,Y+=8),ye=re[z&ie];t:for(;;){if(Q=ye>>>24,z>>>=Q,Y-=Q,Q=ye>>>16&255,Q===0)ee[k++]=ye&65535;else if(Q&16){ae=ye&65535,Q&=15,Q&&(Y<Q&&(z+=me[D++]<<Y,Y+=8),ae+=z&(1<<Q)-1,z>>>=Q,Y-=Q),Y<15&&(z+=me[D++]<<Y,Y+=8,z+=me[D++]<<Y,Y+=8),ye=oe[z&de];n:for(;;){if(Q=ye>>>24,z>>>=Q,Y-=Q,Q=ye>>>16&255,Q&16){if(he=ye&65535,Q&=15,Y<Q&&(z+=me[D++]<<Y,Y+=8,Y<Q&&(z+=me[D++]<<Y,Y+=8)),he+=z&(1<<Q)-1,he>S){N.msg="invalid distance too far back",le.mode=BAD$1;break e}if(z>>>=Q,Y-=Q,Q=k-i,he>Q){if(Q=he-Q,Q>M&&le.sane){N.msg="invalid distance too far back",le.mode=BAD$1;break e}if(ce=0,fe=J,Z===0){if(ce+=C-Q,Q<ae){ae-=Q;do ee[k++]=J[ce++];while(--Q);ce=k-he,fe=ee}}else if(Z<Q){if(ce+=C+Z-Q,Q-=Z,Q<ae){ae-=Q;do ee[k++]=J[ce++];while(--Q);if(ce=0,Z<ae){Q=Z,ae-=Q;do ee[k++]=J[ce++];while(--Q);ce=k-he,fe=ee}}}else if(ce+=Z-Q,Q<ae){ae-=Q;do ee[k++]=J[ce++];while(--Q);ce=k-he,fe=ee}for(;ae>2;)ee[k++]=fe[ce++],ee[k++]=fe[ce++],ee[k++]=fe[ce++],ae-=3;ae&&(ee[k++]=fe[ce++],ae>1&&(ee[k++]=fe[ce++]))}else{ce=k-he;do ee[k++]=ee[ce++],ee[k++]=ee[ce++],ee[k++]=ee[ce++],ae-=3;while(ae>2);ae&&(ee[k++]=ee[ce++],ae>1&&(ee[k++]=ee[ce++]))}}else if((Q&64)===0){ye=oe[(ye&65535)+(z&(1<<Q)-1)];continue n}else{N.msg="invalid distance code",le.mode=BAD$1;break e}break}}else if((Q&64)===0){ye=re[(ye&65535)+(z&(1<<Q)-1)];continue t}else if(Q&32){le.mode=TYPE$1;break e}else{N.msg="invalid literal/length code",le.mode=BAD$1;break e}break}}while(D<b&&k<c);ae=Y>>3,D-=ae,Y-=ae<<3,z&=(1<<Y)-1,N.next_in=D,N.next_out=k,N.avail_in=D<b?5+(b-D):5-(D-b),N.avail_out=k<c?257+(c-k):257-(k-c),le.hold=z,le.bits=Y};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=(O,N,$,D,b,k,i,c)=>{const S=c.bits;let C=0,M=0,Z=0,J=0,z=0,Y=0,re=0,oe=0,ie=0,de=0,ye,Q,ae,he,ce,fe=null,me;const ee=new Uint16Array(MAXBITS+1),le=new Uint16Array(MAXBITS+1);let ve=null,be,we,$e;for(C=0;C<=MAXBITS;C++)ee[C]=0;for(M=0;M<D;M++)ee[N[$+M]]++;for(z=S,J=MAXBITS;J>=1&&ee[J]===0;J--);if(z>J&&(z=J),J===0)return b[k++]=1<<24|64<<16|0,b[k++]=1<<24|64<<16|0,c.bits=1,0;for(Z=1;Z<J&&ee[Z]===0;Z++);for(z<Z&&(z=Z),oe=1,C=1;C<=MAXBITS;C++)if(oe<<=1,oe-=ee[C],oe<0)return-1;if(oe>0&&(O===CODES$1||J!==1))return-1;for(le[1]=0,C=1;C<MAXBITS;C++)le[C+1]=le[C]+ee[C];for(M=0;M<D;M++)N[$+M]!==0&&(i[le[N[$+M]]++]=M);if(O===CODES$1?(fe=ve=i,me=20):O===LENS$1?(fe=lbase,ve=lext,me=257):(fe=dbase,ve=dext,me=0),de=0,M=0,C=Z,ce=k,Y=z,re=0,ae=-1,ie=1<<z,he=ie-1,O===LENS$1&&ie>ENOUGH_LENS$1||O===DISTS$1&&ie>ENOUGH_DISTS$1)return 1;for(;;){be=C-re,i[M]+1<me?(we=0,$e=i[M]):i[M]>=me?(we=ve[i[M]-me],$e=fe[i[M]-me]):(we=96,$e=0),ye=1<<C-re,Q=1<<Y,Z=Q;do Q-=ye,b[ce+(de>>re)+Q]=be<<24|we<<16|$e|0;while(Q!==0);for(ye=1<<C-1;de&ye;)ye>>=1;if(ye!==0?(de&=ye-1,de+=ye):de=0,M++,--ee[C]===0){if(C===J)break;C=N[$+i[M]]}if(C>z&&(de&he)!==ae){for(re===0&&(re=z),ce+=Z,Y=C-re,oe=1<<Y;Y+re<J&&(oe-=ee[Y+re],!(oe<=0));)Y++,oe<<=1;if(ie+=1<<Y,O===LENS$1&&ie>ENOUGH_LENS$1||O===DISTS$1&&ie>ENOUGH_DISTS$1)return 1;ae=de&he,b[ae]=z<<24|Y<<16|ce-k|0}}return de!==0&&(b[ce+de]=C-re<<24|64<<16|0),c.bits=z,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=O=>(O>>>24&255)+(O>>>8&65280)+((O&65280)<<8)+((O&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=O=>{if(!O)return 1;const N=O.state;return!N||N.strm!==O||N.mode<HEAD||N.mode>SYNC?1:0},inflateResetKeep=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const N=O.state;return O.total_in=O.total_out=N.total=0,O.msg="",N.wrap&&(O.adler=N.wrap&1),N.mode=HEAD,N.last=0,N.havedict=0,N.flags=-1,N.dmax=32768,N.head=null,N.hold=0,N.bits=0,N.lencode=N.lendyn=new Int32Array(ENOUGH_LENS),N.distcode=N.distdyn=new Int32Array(ENOUGH_DISTS),N.sane=1,N.back=-1,Z_OK$1},inflateReset=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const N=O.state;return N.wsize=0,N.whave=0,N.wnext=0,inflateResetKeep(O)},inflateReset2=(O,N)=>{let $;if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const D=O.state;return N<0?($=0,N=-N):($=(N>>4)+5,N<48&&(N&=15)),N&&(N<8||N>15)?Z_STREAM_ERROR$1:(D.window!==null&&D.wbits!==N&&(D.window=null),D.wrap=$,D.wbits=N,inflateReset(O))},inflateInit2=(O,N)=>{if(!O)return Z_STREAM_ERROR$1;const $=new InflateState;O.state=$,$.strm=O,$.window=null,$.mode=HEAD;const D=inflateReset2(O,N);return D!==Z_OK$1&&(O.state=null),D},inflateInit=O=>inflateInit2(O,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=O=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let N=0;for(;N<144;)O.lens[N++]=8;for(;N<256;)O.lens[N++]=9;for(;N<280;)O.lens[N++]=7;for(;N<288;)O.lens[N++]=8;for(inftrees(LENS,O.lens,0,288,lenfix,0,O.work,{bits:9}),N=0;N<32;)O.lens[N++]=5;inftrees(DISTS,O.lens,0,32,distfix,0,O.work,{bits:5}),virgin=!1}O.lencode=lenfix,O.lenbits=9,O.distcode=distfix,O.distbits=5},updatewindow=(O,N,$,D)=>{let b;const k=O.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(N.subarray($-k.wsize,$),0),k.wnext=0,k.whave=k.wsize):(b=k.wsize-k.wnext,b>D&&(b=D),k.window.set(N.subarray($-D,$-D+b),k.wnext),D-=b,D?(k.window.set(N.subarray($-D,$),0),k.wnext=D,k.whave=k.wsize):(k.wnext+=b,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=b))),0},inflate$2=(O,N)=>{let $,D,b,k,i,c,S,C,M,Z,J,z,Y,re,oe=0,ie,de,ye,Q,ae,he,ce,fe;const me=new Uint8Array(4);let ee,le;const ve=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(O)||!O.output||!O.input&&O.avail_in!==0)return Z_STREAM_ERROR$1;$=O.state,$.mode===TYPE&&($.mode=TYPEDO),i=O.next_out,b=O.output,S=O.avail_out,k=O.next_in,D=O.input,c=O.avail_in,C=$.hold,M=$.bits,Z=c,J=S,fe=Z_OK$1;e:for(;;)switch($.mode){case HEAD:if($.wrap===0){$.mode=TYPEDO;break}for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if($.wrap&2&&C===35615){$.wbits===0&&($.wbits=15),$.check=0,me[0]=C&255,me[1]=C>>>8&255,$.check=crc32_1($.check,me,2,0),C=0,M=0,$.mode=FLAGS;break}if($.head&&($.head.done=!1),!($.wrap&1)||(((C&255)<<8)+(C>>8))%31){O.msg="incorrect header check",$.mode=BAD;break}if((C&15)!==Z_DEFLATED){O.msg="unknown compression method",$.mode=BAD;break}if(C>>>=4,M-=4,ce=(C&15)+8,$.wbits===0&&($.wbits=ce),ce>15||ce>$.wbits){O.msg="invalid window size",$.mode=BAD;break}$.dmax=1<<$.wbits,$.flags=0,O.adler=$.check=1,$.mode=C&512?DICTID:TYPE,C=0,M=0;break;case FLAGS:for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if($.flags=C,($.flags&255)!==Z_DEFLATED){O.msg="unknown compression method",$.mode=BAD;break}if($.flags&57344){O.msg="unknown header flags set",$.mode=BAD;break}$.head&&($.head.text=C>>8&1),$.flags&512&&$.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,$.check=crc32_1($.check,me,2,0)),C=0,M=0,$.mode=TIME;case TIME:for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.head&&($.head.time=C),$.flags&512&&$.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,me[2]=C>>>16&255,me[3]=C>>>24&255,$.check=crc32_1($.check,me,4,0)),C=0,M=0,$.mode=OS;case OS:for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.head&&($.head.xflags=C&255,$.head.os=C>>8),$.flags&512&&$.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,$.check=crc32_1($.check,me,2,0)),C=0,M=0,$.mode=EXLEN;case EXLEN:if($.flags&1024){for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.length=C,$.head&&($.head.extra_len=C),$.flags&512&&$.wrap&4&&(me[0]=C&255,me[1]=C>>>8&255,$.check=crc32_1($.check,me,2,0)),C=0,M=0}else $.head&&($.head.extra=null);$.mode=EXTRA;case EXTRA:if($.flags&1024&&(z=$.length,z>c&&(z=c),z&&($.head&&(ce=$.head.extra_len-$.length,$.head.extra||($.head.extra=new Uint8Array($.head.extra_len)),$.head.extra.set(D.subarray(k,k+z),ce)),$.flags&512&&$.wrap&4&&($.check=crc32_1($.check,D,z,k)),c-=z,k+=z,$.length-=z),$.length))break e;$.length=0,$.mode=NAME;case NAME:if($.flags&2048){if(c===0)break e;z=0;do ce=D[k+z++],$.head&&ce&&$.length<65536&&($.head.name+=String.fromCharCode(ce));while(ce&&z<c);if($.flags&512&&$.wrap&4&&($.check=crc32_1($.check,D,z,k)),c-=z,k+=z,ce)break e}else $.head&&($.head.name=null);$.length=0,$.mode=COMMENT;case COMMENT:if($.flags&4096){if(c===0)break e;z=0;do ce=D[k+z++],$.head&&ce&&$.length<65536&&($.head.comment+=String.fromCharCode(ce));while(ce&&z<c);if($.flags&512&&$.wrap&4&&($.check=crc32_1($.check,D,z,k)),c-=z,k+=z,ce)break e}else $.head&&($.head.comment=null);$.mode=HCRC;case HCRC:if($.flags&512){for(;M<16;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if($.wrap&4&&C!==($.check&65535)){O.msg="header crc mismatch",$.mode=BAD;break}C=0,M=0}$.head&&($.head.hcrc=$.flags>>9&1,$.head.done=!0),O.adler=$.check=0,$.mode=TYPE;break;case DICTID:for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}O.adler=$.check=zswap32(C),C=0,M=0,$.mode=DICT;case DICT:if($.havedict===0)return O.next_out=i,O.avail_out=S,O.next_in=k,O.avail_in=c,$.hold=C,$.bits=M,Z_NEED_DICT$1;O.adler=$.check=1,$.mode=TYPE;case TYPE:if(N===Z_BLOCK||N===Z_TREES)break e;case TYPEDO:if($.last){C>>>=M&7,M-=M&7,$.mode=CHECK;break}for(;M<3;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}switch($.last=C&1,C>>>=1,M-=1,C&3){case 0:$.mode=STORED;break;case 1:if(fixedtables($),$.mode=LEN_,N===Z_TREES){C>>>=2,M-=2;break e}break;case 2:$.mode=TABLE;break;case 3:O.msg="invalid block type",$.mode=BAD}C>>>=2,M-=2;break;case STORED:for(C>>>=M&7,M-=M&7;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if((C&65535)!==(C>>>16^65535)){O.msg="invalid stored block lengths",$.mode=BAD;break}if($.length=C&65535,C=0,M=0,$.mode=COPY_,N===Z_TREES)break e;case COPY_:$.mode=COPY;case COPY:if(z=$.length,z){if(z>c&&(z=c),z>S&&(z=S),z===0)break e;b.set(D.subarray(k,k+z),i),c-=z,k+=z,S-=z,i+=z,$.length-=z;break}$.mode=TYPE;break;case TABLE:for(;M<14;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if($.nlen=(C&31)+257,C>>>=5,M-=5,$.ndist=(C&31)+1,C>>>=5,M-=5,$.ncode=(C&15)+4,C>>>=4,M-=4,$.nlen>286||$.ndist>30){O.msg="too many length or distance symbols",$.mode=BAD;break}$.have=0,$.mode=LENLENS;case LENLENS:for(;$.have<$.ncode;){for(;M<3;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.lens[ve[$.have++]]=C&7,C>>>=3,M-=3}for(;$.have<19;)$.lens[ve[$.have++]]=0;if($.lencode=$.lendyn,$.lenbits=7,ee={bits:$.lenbits},fe=inftrees(CODES,$.lens,0,19,$.lencode,0,$.work,ee),$.lenbits=ee.bits,fe){O.msg="invalid code lengths set",$.mode=BAD;break}$.have=0,$.mode=CODELENS;case CODELENS:for(;$.have<$.nlen+$.ndist;){for(;oe=$.lencode[C&(1<<$.lenbits)-1],ie=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ie<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(ye<16)C>>>=ie,M-=ie,$.lens[$.have++]=ye;else{if(ye===16){for(le=ie+2;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(C>>>=ie,M-=ie,$.have===0){O.msg="invalid bit length repeat",$.mode=BAD;break}ce=$.lens[$.have-1],z=3+(C&3),C>>>=2,M-=2}else if(ye===17){for(le=ie+3;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=ie,M-=ie,ce=0,z=3+(C&7),C>>>=3,M-=3}else{for(le=ie+7;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=ie,M-=ie,ce=0,z=11+(C&127),C>>>=7,M-=7}if($.have+z>$.nlen+$.ndist){O.msg="invalid bit length repeat",$.mode=BAD;break}for(;z--;)$.lens[$.have++]=ce}}if($.mode===BAD)break;if($.lens[256]===0){O.msg="invalid code -- missing end-of-block",$.mode=BAD;break}if($.lenbits=9,ee={bits:$.lenbits},fe=inftrees(LENS,$.lens,0,$.nlen,$.lencode,0,$.work,ee),$.lenbits=ee.bits,fe){O.msg="invalid literal/lengths set",$.mode=BAD;break}if($.distbits=6,$.distcode=$.distdyn,ee={bits:$.distbits},fe=inftrees(DISTS,$.lens,$.nlen,$.ndist,$.distcode,0,$.work,ee),$.distbits=ee.bits,fe){O.msg="invalid distances set",$.mode=BAD;break}if($.mode=LEN_,N===Z_TREES)break e;case LEN_:$.mode=LEN;case LEN:if(c>=6&&S>=258){O.next_out=i,O.avail_out=S,O.next_in=k,O.avail_in=c,$.hold=C,$.bits=M,inffast(O,J),i=O.next_out,b=O.output,S=O.avail_out,k=O.next_in,D=O.input,c=O.avail_in,C=$.hold,M=$.bits,$.mode===TYPE&&($.back=-1);break}for($.back=0;oe=$.lencode[C&(1<<$.lenbits)-1],ie=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ie<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if(de&&(de&240)===0){for(Q=ie,ae=de,he=ye;oe=$.lencode[he+((C&(1<<Q+ae)-1)>>Q)],ie=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(Q+ie<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=Q,M-=Q,$.back+=Q}if(C>>>=ie,M-=ie,$.back+=ie,$.length=ye,de===0){$.mode=LIT;break}if(de&32){$.back=-1,$.mode=TYPE;break}if(de&64){O.msg="invalid literal/length code",$.mode=BAD;break}$.extra=de&15,$.mode=LENEXT;case LENEXT:if($.extra){for(le=$.extra;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.length+=C&(1<<$.extra)-1,C>>>=$.extra,M-=$.extra,$.back+=$.extra}$.was=$.length,$.mode=DIST;case DIST:for(;oe=$.distcode[C&(1<<$.distbits)-1],ie=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(ie<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if((de&240)===0){for(Q=ie,ae=de,he=ye;oe=$.distcode[he+((C&(1<<Q+ae)-1)>>Q)],ie=oe>>>24,de=oe>>>16&255,ye=oe&65535,!(Q+ie<=M);){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}C>>>=Q,M-=Q,$.back+=Q}if(C>>>=ie,M-=ie,$.back+=ie,de&64){O.msg="invalid distance code",$.mode=BAD;break}$.offset=ye,$.extra=de&15,$.mode=DISTEXT;case DISTEXT:if($.extra){for(le=$.extra;M<le;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}$.offset+=C&(1<<$.extra)-1,C>>>=$.extra,M-=$.extra,$.back+=$.extra}if($.offset>$.dmax){O.msg="invalid distance too far back",$.mode=BAD;break}$.mode=MATCH;case MATCH:if(S===0)break e;if(z=J-S,$.offset>z){if(z=$.offset-z,z>$.whave&&$.sane){O.msg="invalid distance too far back",$.mode=BAD;break}z>$.wnext?(z-=$.wnext,Y=$.wsize-z):Y=$.wnext-z,z>$.length&&(z=$.length),re=$.window}else re=b,Y=i-$.offset,z=$.length;z>S&&(z=S),S-=z,$.length-=z;do b[i++]=re[Y++];while(--z);$.length===0&&($.mode=LEN);break;case LIT:if(S===0)break e;b[i++]=$.length,S--,$.mode=LEN;break;case CHECK:if($.wrap){for(;M<32;){if(c===0)break e;c--,C|=D[k++]<<M,M+=8}if(J-=S,O.total_out+=J,$.total+=J,$.wrap&4&&J&&(O.adler=$.check=$.flags?crc32_1($.check,b,J,i-J):adler32_1($.check,b,J,i-J)),J=S,$.wrap&4&&($.flags?C:zswap32(C))!==$.check){O.msg="incorrect data check",$.mode=BAD;break}C=0,M=0}$.mode=LENGTH;case LENGTH:if($.wrap&&$.flags){for(;M<32;){if(c===0)break e;c--,C+=D[k++]<<M,M+=8}if($.wrap&4&&C!==($.total&4294967295)){O.msg="incorrect length check",$.mode=BAD;break}C=0,M=0}$.mode=DONE;case DONE:fe=Z_STREAM_END$1;break e;case BAD:fe=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return O.next_out=i,O.avail_out=S,O.next_in=k,O.avail_in=c,$.hold=C,$.bits=M,($.wsize||J!==O.avail_out&&$.mode<BAD&&($.mode<CHECK||N!==Z_FINISH$1))&&updatewindow(O,O.output,O.next_out,J-O.avail_out),Z-=O.avail_in,J-=O.avail_out,O.total_in+=Z,O.total_out+=J,$.total+=J,$.wrap&4&&J&&(O.adler=$.check=$.flags?crc32_1($.check,b,J,O.next_out-J):adler32_1($.check,b,J,O.next_out-J)),O.data_type=$.bits+($.last?64:0)+($.mode===TYPE?128:0)+($.mode===LEN_||$.mode===COPY_?256:0),(Z===0&&J===0||N===Z_FINISH$1)&&fe===Z_OK$1&&(fe=Z_BUF_ERROR),fe},inflateEnd=O=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;let N=O.state;return N.window&&(N.window=null),O.state=null,Z_OK$1},inflateGetHeader=(O,N)=>{if(inflateStateCheck(O))return Z_STREAM_ERROR$1;const $=O.state;return($.wrap&2)===0?Z_STREAM_ERROR$1:($.head=N,N.done=!1,Z_OK$1)},inflateSetDictionary=(O,N)=>{const $=N.length;let D,b,k;return inflateStateCheck(O)||(D=O.state,D.wrap!==0&&D.mode!==DICT)?Z_STREAM_ERROR$1:D.mode===DICT&&(b=1,b=adler32_1(b,N,$,0),b!==D.check)?Z_DATA_ERROR$1:(k=updatewindow(O,N,$,$),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(O){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},O||{});const N=this.options;N.raw&&N.windowBits>=0&&N.windowBits<16&&(N.windowBits=-N.windowBits,N.windowBits===0&&(N.windowBits=-15)),N.windowBits>=0&&N.windowBits<16&&!(O&&O.windowBits)&&(N.windowBits+=32),N.windowBits>15&&N.windowBits<48&&(N.windowBits&15)===0&&(N.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let $=inflate_1$2.inflateInit2(this.strm,N.windowBits);if($!==Z_OK)throw new Error(messages[$]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),N.dictionary&&(typeof N.dictionary=="string"?N.dictionary=strings.string2buf(N.dictionary):toString.call(N.dictionary)==="[object ArrayBuffer]"&&(N.dictionary=new Uint8Array(N.dictionary)),N.raw&&($=inflate_1$2.inflateSetDictionary(this.strm,N.dictionary),$!==Z_OK)))throw new Error(messages[$])}Inflate$1.prototype.push=function(O,N){const $=this.strm,D=this.options.chunkSize,b=this.options.dictionary;let k,i,c;if(this.ended)return!1;for(N===~~N?i=N:i=N===!0?Z_FINISH:Z_NO_FLUSH,toString.call(O)==="[object ArrayBuffer]"?$.input=new Uint8Array(O):$.input=O,$.next_in=0,$.avail_in=$.input.length;;){for($.avail_out===0&&($.output=new Uint8Array(D),$.next_out=0,$.avail_out=D),k=inflate_1$2.inflate($,i),k===Z_NEED_DICT&&b&&(k=inflate_1$2.inflateSetDictionary($,b),k===Z_OK?k=inflate_1$2.inflate($,i):k===Z_DATA_ERROR&&(k=Z_NEED_DICT));$.avail_in>0&&k===Z_STREAM_END&&$.state.wrap>0&&O[$.next_in]!==0;)inflate_1$2.inflateReset($),k=inflate_1$2.inflate($,i);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(c=$.avail_out,$.next_out&&($.avail_out===0||k===Z_STREAM_END))if(this.options.to==="string"){let S=strings.utf8border($.output,$.next_out),C=$.next_out-S,M=strings.buf2string($.output,S);$.next_out=C,$.avail_out=D-C,C&&$.output.set($.output.subarray(S,S+C),0),this.onData(M)}else this.onData($.output.length===$.next_out?$.output:$.output.subarray(0,$.next_out));if(!(k===Z_OK&&c===0)){if(k===Z_STREAM_END)return k=inflate_1$2.inflateEnd(this.strm),this.onEnd(k),this.ended=!0,!0;if($.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(O){this.chunks.push(O)},Inflate$1.prototype.onEnd=function(O){O===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=O,this.msg=this.strm.msg};function inflate$1(O,N){const $=new Inflate$1(N);if($.push(O),$.err)throw $.msg||messages[$.err];return $.result}function inflateRaw$1(O,N){return N=N||{},N.raw=!0,inflate$1(O,N)}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 ignoreEvent=["updateSeverTime"];ignoreEvent.push("heartbeat"),ignoreEvent.push("heartbeatEx"),ignoreEvent.push("networkQualityChange"),ignoreEvent.push("onNetQuality"),ignoreEvent.push("updateCall"),ignoreEvent.push("pubNotify");const compressArrayBuffer=O=>{const N=new Uint8Array(O),$=pako.deflate(N,{gzip:!0});return new Uint8Array($==null?void 0:$.buffer)},decompressArrayBuffer=O=>{const N=new Uint8Array(O),$=pako.inflate(N,{gzip:!0});return new Uint8Array($==null?void 0:$.buffer)},sendMessageFormat=O=>{const{event:N}=O;switch(O.data_original=O.data,O.time&&(O.timeStr=E(O.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),N){case"login":O.data=com.quick.voice.proto.Login.encode(O.data).finish();break;case"joinRoom":case"joinRoomEx":O.data=com.quick.voice.proto.JoinReq.encode(O.data).finish();break;case"quitRoom":O.data=com.quick.voice.proto.QuitReq.encode(O.data).finish();break;case"connectCF":O.data=com.quick.voice.proto.ConnectCFReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"publish":O.data=com.quick.voice.proto.PublishReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"pubChannel":O.data=com.quick.voice.proto.ChannelPublishReq.encode(O.data).finish();break;case"subscribe":O.data=com.quick.voice.proto.SubscribeReq.encode(O.data).finish();break;case"subChannel":O.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(O.data).finish();break;case"closeTrack":O.data=com.quick.voice.proto.CloseTrackReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"renegotiate":O.data=com.quick.voice.proto.RenegotiateReq.encode(O.data).finish(),O.data=compressArrayBuffer(O.data),O.compress=!0;break;case"syncRoomInfo":O.data=com.quick.voice.proto.SyncRoomInfoReq.encode(O.data).finish();break;case"updateCall":O.data=com.quick.voice.proto.UpdateCall.encode(O.data).finish();break;case"networkQualityChange":O.data=com.quick.voice.proto.NetQualityChange.encode(O.data).finish();break;case"pubNotify":O.data=com.quick.voice.proto.PublishNotify.encode(O.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":O.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(O.data).finish();break;default:O.data=new Uint8Array;break}return O},onMessageFormat=O=>{const{event:N,compress:$=!1}=O;if(O.data_remote=O.data,O.time&&(O.timeStr=E(O.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),$)try{O.data=decompressArrayBuffer(O.data)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",D)}switch(N){case"login":O.data=com.quick.voice.proto.Login.decode(O.data);break;case"joinRoom":case"joinRoomEx":O.data=com.quick.voice.proto.JoinRsp.decode(O.data);break;case"onJoinRoom":O.data=com.quick.voice.proto.JoinNotify.decode(O.data);break;case"onQuitRoom":O.data=com.quick.voice.proto.QuitNotify.decode(O.data);break;case"connectCF":O.data=com.quick.voice.proto.ConnectCFRsp.decode(O.data);break;case"publish":O.data=com.quick.voice.proto.PublishRsp.decode(O.data);break;case"pubChannel":O.data=com.quick.voice.proto.ChannelPublishRsq.decode(O.data);break;case"onPublish":O.data=com.quick.voice.proto.PublishNotify.decode(O.data);break;case"subscribe":O.data=com.quick.voice.proto.SubscribeRsp.decode(O.data);break;case"subChannel":O.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(O.data);break;case"closeTrack":O.data=com.quick.voice.proto.CloseTrackRsp.decode(O.data);break;case"onCloseTrack":O.data=com.quick.voice.proto.CloseTrackNotify.decode(O.data);break;case"onUpdateCall":O.data=com.quick.voice.proto.UpdateCall.decode(O.data);break;case"onDataChannelPublish":O.data=com.quick.voice.proto.UserChannel.decode(O.data);break;case"onDestroyRoom":O.data=com.quick.voice.proto.QuitNotify.decode(O.data);break;case"onUpdatePermissions":O.data=com.quick.voice.proto.UpdatePermissions.decode(O.data);break;case"onNetQuality":O.data=com.quick.voice.proto.NetQualityNotify.decode(O.data);break;case"syncRoomInfo":O.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(O.data);break;case"onCDNPlayUrlAdd":O.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(O.data);break;case"onUpdateBehavior":O.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(O.data);break;case"debugger":O.data=JSON.parse(new TextDecoder().decode(O.data));break}return O};class CallsWebSocket{constructor(N){ke(this,Oe,{url:"wss://demo.putplay.cc/websocket",debug:!1,timeout:30*1e3});ne(this,"prws",new I({url:"",binaryType:"arraybuffer",reconnectCount:5,timeout:10*1e3}));ke(this,Te,{});ke(this,Ce,{});ne(this,"state","closed");ke(this,at,(N,$={})=>{try{const{time:D,event:b,data:k={},data_original:i={},data_remote:c,...S}=$,C=E(D,"YYYY-MM-DD hh:mm:ss",{offset:480});let M={};const Z=(ye={})=>{const Q=JSON.parse(JSON.stringify(ye)),ae=Object.keys(Q);for(const he of ae)(he.includes("sdp")||he.includes("Sdp"))&&(Q[he]="");return Q};let J="res ↓";switch(N){case"res":J="res ↓",M=Z(k);break;case"req":J="req ↑",M=Z(i);break}let z="#quickvo.logs";ignoreEvent.includes(b)&&(z="#quickvo.ignoreEvents");const Y={"#action":J,timeStr:C,event:b,data:M,time:D,...S},re=localStorage.getItem(z)||JSON.stringify([]),oe=JSON.parse(re);let ie=b==="heartbeat"||b==="heartbeatEx";const de=[Y];for(const ye of oe){const{event:Q}=ye;if(Q==="heartbeat"||Q==="heartbeatEx"){if(ie)continue;ie=!0}if(de.length===200)break;de.push(ye)}localStorage.setItem(z,JSON.stringify(de))}catch(D){se(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",D)}});ke(this,Lt,(N,{resolve:$,reject:D})=>{const{sn:b=""}=N,k=()=>{const c=se(this,Te)[b];clearTimeout(c.destructionTimer),delete se(this,Te)[b]},i=window.setTimeout(()=>{const c=se(this,Te)[b];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",c.message),k(),D("event is timeout")},se(this,Oe).timeout);se(this,Te)[b]={message:N,resolve:$,reject:D,destruction:k,destructionTimer:i}});ke(this,Ft,N=>se(this,Te)[N]);ke(this,jt,async N=>{const $=new Uint8Array(N),D=com.quick.voice.proto.CommonRsp.decode($),{sn:b,event:k}=D,i=onMessageFormat(D);if(se(this,Oe).debug&&!ignoreEvent.includes(k)&&(se(this,at).call(this,"res",i),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i)),notifyName_keys.includes(k))return this.emitNotify(k,P$1(i,["code","data","desc"]));const S=se(this,Ft).call(this,b);if(S){const{resolve:C=Z=>{},destruction:M=()=>{}}=S;C(P$1(i,["code","data","desc"])),M()}});ne(this,"clearEvents",(N=[])=>{const $=Object.keys(se(this,Te));N.length===0&&(N=$);for(const D of $){if(!N.includes(D))continue;const b=se(this,Te)[D];if(b){const{destruction:k}=b;k()}}});ne(this,"connect",async()=>new Promise(async(N,$)=>{try{this.prws&&(this.prws.close(),this.state="closed");const D=new Date().getTime();if(this.state="connecting",await this.prws.connect(),this.state="connected",se(this,Oe).debug){const k=new Date().getTime()-D;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${k}ms-广播事件`,se(this,Ce))}N(this.prws)}catch(D){$(D)}}));ne(this,"close",async()=>{var $;se(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const N=Object.keys(se(this,Te));for(const D of N){const{destructionTimer:b}=se(this,Te)[D];clearTimeout(b)}Be(this,Te,{}),await(($=this.prws)==null?void 0:$.close()),this.state="closed"});ne(this,"sendMessage",(N,$=!0)=>new Promise(async(D,b)=>{var M;const{event:k,...i}=N,c=Date.now(),S=sendMessageFormat({event:k,sn:+`${c}${v$1(1e3,9999)}`,time:c,valid:se(this,Oe).timeout,version:1,compress:!1,...i});se(this,Oe).debug&&!ignoreEvent.includes(k)&&(se(this,at).call(this,"req",S),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",S)),$&&se(this,Lt).call(this,S,{resolve:D,reject:b});const C=com.quick.voice.proto.CommonReq.encode(S).finish();(M=this.prws)==null||M.sendMessage(C)}));ne(this,"emitNotify",async(N,$)=>{const D=se(this,Ce)[N]||[];for(const b of D){const{callback:k=async()=>{}}=b;await k($)}});ne(this,"addNotify",(N,$=!1)=>{const{event:D,sn:b=xt(32)}=N;se(this,Ce)[D]||(se(this,Ce)[D]=[]);const k=se(this,Ce)[D],i=k.findIndex(c=>c.sn===b);return i!==-1&&k.splice(i,1),$?k.unshift(N):k.push(N),b});ne(this,"removeNotify",(N=[])=>{if(N.length===0)Be(this,Ce,{});else{const $=Object.keys(se(this,Ce));for(const D of $)se(this,Ce)[D]=se(this,Ce)[D].filter(b=>!N.includes(b.sn||""))}se(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",se(this,Ce))});Be(this,Oe,{...se(this,Oe),...N}),this.prws.setOptions(se(this,Oe)),this.prws.onMessage=se(this,jt),this.prws.getHeartbeatMsg=()=>""}}Oe=new WeakMap,Te=new WeakMap,Ce=new WeakMap,at=new WeakMap,Lt=new WeakMap,Ft=new WeakMap,jt=new WeakMap;const createMutedAudioStream=O=>{const N=O.createOscillator();N.type="sine",N.frequency.setValueAtTime(0,O.currentTime);const $=O.createGain();$.gain.value=0,N.connect($),$.connect(O.destination),N.start();const D=O.createMediaStreamDestination();return $.disconnect(),N.connect(D),D.stream},createFakeVideoStream=(O=10,N=10,$=30)=>{const D=document.createElement("canvas"),b=D.getContext("2d");D.width=O,D.height=N;let k=0;return setInterval(()=>{b.clearRect(0,0,D.width,D.height);const S=b.createLinearGradient(0,0,D.width,D.height);S.addColorStop(0,`hsla(${k}, 100%, 50%, 0)`),S.addColorStop(1,`hsla(${k+120}, 100%, 50%, 0)`),b.fillStyle=S,b.fillRect(0,0,D.width,D.height),k=(k+1)%360},100),D.captureStream($)};class NetworkQualityTester{constructor(N=[]){ne(this,"targetUrls",[]);ne(this,"results",[]);N.length===0&&N.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=N,this.results=[]}async testAll(){const N=this.targetUrls.map($=>this.testUrl($));return await Promise.all(N),this.analyzeResults()}async testUrl(N){const $=performance.now();let D=0,b=!1;try{await fetch(N,{method:"HEAD",cache:"no-store"});const k=performance.now()-$,i=performance.now(),S=await(await fetch(N,{cache:"no-store"})).blob(),C=performance.now()-i;D=S.size,b=!0,this.results.push({url:N,success:b,headTime:k,getTime:C,size:D,downloadSpeed:D>0?(D/1024/(C/1e3)).toFixed(2):0,totalTime:performance.now()-$})}catch(k){this.results.push({url:N,success:!1,error:k.message,totalTime:performance.now()-$})}}analyzeResults(){const N=this.results.filter(k=>k.success);if(N.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const $=N.reduce((k,i)=>k+i.size,0),D=N.reduce((k,i)=>k+i.totalTime,0),b=N.reduce((k,i)=>k+parseFloat(i.downloadSpeed),0)/N.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:N.length,averageDownloadSpeed:`${b.toFixed(2)} KB/s`,averageResponseTime:`${(D/N.length).toFixed(2)}ms`,totalDataTransferred:`${($/1024).toFixed(2)} KB`,detailedResults:this.results}}}var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,function(O){(function(N){var $="undefined",D=$!==typeof Buffer&&Buffer,b=$!==typeof Uint8Array&&Uint8Array,k=$!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],c=Array.isArray||he,S=4294967296,C=16777216,M;Z("Uint64BE",!0,!0),Z("Int64BE",!0,!1),Z("Uint64LE",!1,!0),Z("Int64LE",!1,!1);function Z(ce,fe,me){var ee=fe?0:4,le=fe?4:0,ve=fe?0:3,be=fe?1:2,we=fe?2:1,$e=fe?3:0,Ne=fe?de:Q,Le=fe?ye:ae,Fe=Re.prototype,We="is"+ce,ft="_"+We;return Fe.buffer=void 0,Fe.offset=0,Fe[ft]=!0,Fe.toNumber=Ke,Fe.toString=rt,Fe.toJSON=Ke,Fe.toArray=J,D&&(Fe.toBuffer=z),b&&(Fe.toArrayBuffer=Y),Re[We]=xe,N[ce]=Re,Re;function Re(ge,_e,Se,Ie){return this instanceof Re?it(this,ge,_e,Se,Ie):new Re(ge,_e,Se,Ie)}function xe(ge){return!!(ge&&ge[ft])}function it(ge,_e,Se,Ie,De){if(b&&k&&(_e instanceof k&&(_e=new b(_e)),Ie instanceof k&&(Ie=new b(Ie))),!_e&&!Se&&!Ie&&!M){ge.buffer=ie(i,0);return}if(!re(_e,Se)){var je=M||Array;De=Se,Ie=_e,Se=0,_e=M===D?D.alloc(8):new je(8)}ge.buffer=_e,ge.offset=Se|=0,$!==typeof Ie&&(typeof Ie=="string"?Me(_e,Se,Ie,De||10):re(Ie,De)?oe(_e,Se,Ie,De):typeof De=="number"?(Ye(_e,Se+ee,Ie),Ye(_e,Se+le,De)):Ie>0?Ne(_e,Se,Ie):Ie<0?Le(_e,Se,Ie):oe(_e,Se,i,0))}function Me(ge,_e,Se,Ie){var De=0,je=Se.length,Je=0,Ze=0;Se[0]==="-"&&De++;for(var ot=De;De<je;){var mt=parseInt(Se[De++],Ie);if(!(mt>=0))break;Ze=Ze*Ie+mt,Je=Je*Ie+Math.floor(Ze/S),Ze%=S}ot&&(Je=~Je,Ze?Ze=S-Ze:Je++),Ye(ge,_e+ee,Je),Ye(ge,_e+le,Ze)}function Ke(){var ge=this.buffer,_e=this.offset,Se=He(ge,_e+ee),Ie=He(ge,_e+le);return me||(Se|=0),Se?Se*S+Ie:Ie}function rt(ge){var _e=this.buffer,Se=this.offset,Ie=He(_e,Se+ee),De=He(_e,Se+le),je="",Je=!me&&Ie&2147483648;for(Je&&(Ie=~Ie,De=S-De),ge=ge||10;;){var Ze=Ie%ge*S+De;if(Ie=Math.floor(Ie/ge),De=Math.floor(Ze/ge),je=(Ze%ge).toString(ge)+je,!Ie&&!De)break}return Je&&(je="-"+je),je}function Ye(ge,_e,Se){ge[_e+$e]=Se&255,Se=Se>>8,ge[_e+we]=Se&255,Se=Se>>8,ge[_e+be]=Se&255,Se=Se>>8,ge[_e+ve]=Se&255}function He(ge,_e){return ge[_e+ve]*C+(ge[_e+be]<<16)+(ge[_e+we]<<8)+ge[_e+$e]}}function J(ce){var fe=this.buffer,me=this.offset;return M=null,ce!==!1&&c(fe)?fe.length===8?fe:fe.slice(me,me+8):ie(fe,me)}function z(ce){var fe=this.buffer,me=this.offset;return M=D,ce!==!1&&D.isBuffer(fe)?fe.length===8?fe:fe.slice(me,me+8):D.from(Y.call(this,ce))}function Y(ce){var fe=this.buffer,me=this.offset,ee=fe.buffer;if(M=b,ce!==!1&&!fe.offset&&ee instanceof k)return ee.byteLength===8?ee:ee.slice(me,me+8);var le=new b(8);return oe(le,0,fe,me),le.buffer}function re(ce,fe){var me=ce&&ce.length;return fe|=0,me&&fe+8<=me&&typeof ce[fe]!="string"}function oe(ce,fe,me,ee){fe|=0,ee|=0;for(var le=0;le<8;le++)ce[fe++]=me[ee++]&255}function ie(ce,fe){return Array.prototype.slice.call(ce,fe,fe+8)}function de(ce,fe,me){for(var ee=fe+8;ee>fe;)ce[--ee]=me&255,me/=256}function ye(ce,fe,me){var ee=fe+8;for(me++;ee>fe;)ce[--ee]=-me&255^255,me/=256}function Q(ce,fe,me){for(var ee=fe+8;fe<ee;)ce[fe++]=me&255,me/=256}function ae(ce,fe,me){var ee=fe+8;for(me++;fe<ee;)ce[fe++]=-me&255^255,me/=256}function he(ce){return!!ce&&Object.prototype.toString.call(ce)=="[object Array]"}})(typeof O.nodeName!="string"?O:int64Buffer||{})}(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
4
+ between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var O=requireTools(),N=requireTools(),$=requireEbmlID(),D=function(){function b(){this._schema=$.byEbmlID,this._buffers=[],this._stack=[]}return b.prototype.encode=function(k){var i=this;return O.concat(k.reduce(function(c,S){return c.concat(i.encodeChunk(S))},[])).buffer},b.prototype.encodeChunk=function(k){return k.type==="m"?k.isEnd?this.endTag(k):this.startTag(k):(k.data=N.Buffer.from(k.data),this.writeTag(k)),this.flush()},b.prototype.flush=function(){var k=this._buffers;return this._buffers=[],k},b.prototype.getSchemaInfo=function(k){for(var i=Object.keys(this._schema).map(Number),c=0;c<i.length;c++){var S=i[c];if(this._schema[S].name===k)return new N.Buffer(S.toString(16),"hex")}return null},b.prototype.writeTag=function(k){var i=k.name,c=this.getSchemaInfo(i),S=k.data;if(c==null)throw new Error("No schema entry found for "+i);var C=O.encodeTag(c,S);if(this._stack.length>0){var M=this._stack[this._stack.length-1];M.children.push({tagId:c,elm:k,children:[],data:C});return}this._buffers=this._buffers.concat(C)},b.prototype.startTag=function(k){var i=k.name,c=this.getSchemaInfo(i);if(c==null)throw new Error("No schema entry found for "+i);if(k.unknownSize){var S=O.encodeTag(c,new N.Buffer(0),k.unknownSize);this._buffers=this._buffers.concat(S);return}var C={tagId:c,elm:k,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(C),this._stack.push(C)},b.prototype.endTag=function(k){k.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==k.name)throw new Error("EBML structure is broken");var c=i.children.reduce(function(C,M){if(M.data===null)throw new Error("EBML structure is broken");return C.concat(M.data)},[]),S=O.concat(c);i.elm.type==="m"?i.data=O.encodeTag(i.tagId,S,i.elm.unknownSize):i.data=O.encodeTag(i.tagId,S),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},b}();return EBMLEncoder.default=D,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=c,base64Js.toByteArray=C,base64Js.fromByteArray=J;for(var O=[],N=[],$=typeof Uint8Array<"u"?Uint8Array:Array,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=0,k=D.length;b<k;++b)O[b]=D[b],N[D.charCodeAt(b)]=b;N[45]=62,N[95]=63;function i(z){var Y=z.length;if(Y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var re=z.indexOf("=");re===-1&&(re=Y);var oe=re===Y?0:4-re%4;return[re,oe]}function c(z){var Y=i(z),re=Y[0],oe=Y[1];return(re+oe)*3/4-oe}function S(z,Y,re){return(Y+re)*3/4-re}function C(z){var Y,re=i(z),oe=re[0],ie=re[1],de=new $(S(z,oe,ie)),ye=0,Q=ie>0?oe-4:oe,ae;for(ae=0;ae<Q;ae+=4)Y=N[z.charCodeAt(ae)]<<18|N[z.charCodeAt(ae+1)]<<12|N[z.charCodeAt(ae+2)]<<6|N[z.charCodeAt(ae+3)],de[ye++]=Y>>16&255,de[ye++]=Y>>8&255,de[ye++]=Y&255;return ie===2&&(Y=N[z.charCodeAt(ae)]<<2|N[z.charCodeAt(ae+1)]>>4,de[ye++]=Y&255),ie===1&&(Y=N[z.charCodeAt(ae)]<<10|N[z.charCodeAt(ae+1)]<<4|N[z.charCodeAt(ae+2)]>>2,de[ye++]=Y>>8&255,de[ye++]=Y&255),de}function M(z){return O[z>>18&63]+O[z>>12&63]+O[z>>6&63]+O[z&63]}function Z(z,Y,re){for(var oe,ie=[],de=Y;de<re;de+=3)oe=(z[de]<<16&16711680)+(z[de+1]<<8&65280)+(z[de+2]&255),ie.push(M(oe));return ie.join("")}function J(z){for(var Y,re=z.length,oe=re%3,ie=[],de=16383,ye=0,Q=re-oe;ye<Q;ye+=de)ie.push(Z(z,ye,ye+de>Q?Q:ye+de));return oe===1?(Y=z[re-1],ie.push(O[Y>>2]+O[Y<<4&63]+"==")):oe===2&&(Y=(z[re-2]<<8)+z[re-1],ie.push(O[Y>>10]+O[Y>>4&63]+O[Y<<2&63]+"=")),ie.join("")}return base64Js}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(O,N,$,D,b){var k,i,c=b*8-D-1,S=(1<<c)-1,C=S>>1,M=-7,Z=$?b-1:0,J=$?-1:1,z=O[N+Z];for(Z+=J,k=z&(1<<-M)-1,z>>=-M,M+=c;M>0;k=k*256+O[N+Z],Z+=J,M-=8);for(i=k&(1<<-M)-1,k>>=-M,M+=D;M>0;i=i*256+O[N+Z],Z+=J,M-=8);if(k===0)k=1-C;else{if(k===S)return i?NaN:(z?-1:1)*(1/0);i=i+Math.pow(2,D),k=k-C}return(z?-1:1)*i*Math.pow(2,k-D)},ieee754.write=function(O,N,$,D,b,k){var i,c,S,C=k*8-b-1,M=(1<<C)-1,Z=M>>1,J=b===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=D?0:k-1,Y=D?1:-1,re=N<0||N===0&&1/N<0?1:0;for(N=Math.abs(N),isNaN(N)||N===1/0?(c=isNaN(N)?1:0,i=M):(i=Math.floor(Math.log(N)/Math.LN2),N*(S=Math.pow(2,-i))<1&&(i--,S*=2),i+Z>=1?N+=J/S:N+=J*Math.pow(2,1-Z),N*S>=2&&(i++,S/=2),i+Z>=M?(c=0,i=M):i+Z>=1?(c=(N*S-1)*Math.pow(2,b),i=i+Z):(c=N*Math.pow(2,Z-1)*Math.pow(2,b),i=0));b>=8;O[$+z]=c&255,z+=Y,c/=256,b-=8);for(i=i<<b|c,C+=b;C>0;O[$+z]=i&255,z+=Y,i/=256,C-=8);O[$+z-Y]|=re*128}),ieee754}/*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
- */var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(O){const N=requireBase64Js(),I=requireIeee754(),D=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;O.Buffer=c,O.SlowBuffer=de,O.INSPECT_MAX_BYTES=50;const f=2147483647;O.kMaxLength=f,c.TYPED_ARRAY_SUPPORT=k(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function k(){try{const K=new Uint8Array(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,Uint8Array.prototype),Object.setPrototypeOf(K,F),K.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function i(K){if(K>f)throw new RangeError('The value "'+K+'" is invalid for option "size"');const F=new Uint8Array(K);return Object.setPrototypeOf(F,c.prototype),F}function c(K,F,j){if(typeof K=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return J(K)}return $(K,F,j)}c.poolSize=8192;function $(K,F,j){if(typeof K=="string")return Z(K,F);if(ArrayBuffer.isView(K))return X(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(nt(K,ArrayBuffer)||K&&nt(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(nt(K,SharedArrayBuffer)||K&&nt(K.buffer,SharedArrayBuffer)))return re(K,F,j);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=K.valueOf&&K.valueOf();if(Y!=null&&Y!==K)return c.from(Y,F,j);const te=oe(K);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return c.from(K[Symbol.toPrimitive]("string"),F,j);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}c.from=function(K,F,j){return $(K,F,j)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function C(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function M(K,F,j){return C(K),K<=0?i(K):F!==void 0?typeof j=="string"?i(K).fill(F,j):i(K).fill(F):i(K)}c.alloc=function(K,F,j){return M(K,F,j)};function J(K){return C(K),i(K<0?0:ne(K)|0)}c.allocUnsafe=function(K){return J(K)},c.allocUnsafeSlow=function(K){return J(K)};function Z(K,F){if((typeof F!="string"||F==="")&&(F="utf8"),!c.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const j=ye(K,F)|0;let Y=i(j);const te=Y.write(K,F);return te!==j&&(Y=Y.slice(0,te)),Y}function z(K){const F=K.length<0?0:ne(K.length)|0,j=i(F);for(let Y=0;Y<F;Y+=1)j[Y]=K[Y]&255;return j}function X(K){if(nt(K,Uint8Array)){const F=new Uint8Array(K);return re(F.buffer,F.byteOffset,F.byteLength)}return z(K)}function re(K,F,j){if(F<0||K.byteLength<F)throw new RangeError('"offset" is outside of buffer bounds');if(K.byteLength<F+(j||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return F===void 0&&j===void 0?Y=new Uint8Array(K):j===void 0?Y=new Uint8Array(K,F):Y=new Uint8Array(K,F,j),Object.setPrototypeOf(Y,c.prototype),Y}function oe(K){if(c.isBuffer(K)){const F=ne(K.length)|0,j=i(F);return j.length===0||K.copy(j,0,0,F),j}if(K.length!==void 0)return typeof K.length!="number"||on(K.length)?i(0):z(K);if(K.type==="Buffer"&&Array.isArray(K.data))return z(K.data)}function ne(K){if(K>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return K|0}function de(K){return+K!=K&&(K=0),c.alloc(+K)}c.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==c.prototype},c.compare=function(F,j){if(nt(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),nt(j,Uint8Array)&&(j=c.from(j,j.offset,j.byteLength)),!c.isBuffer(F)||!c.isBuffer(j))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===j)return 0;let Y=F.length,te=j.length;for(let ue=0,pe=Math.min(Y,te);ue<pe;++ue)if(F[ue]!==j[ue]){Y=F[ue],te=j[ue];break}return Y<te?-1:te<Y?1:0},c.isEncoding=function(F){switch(String(F).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(F,j){if(!Array.isArray(F))throw new TypeError('"list" argument must be an Array of Buffers');if(F.length===0)return c.alloc(0);let Y;if(j===void 0)for(j=0,Y=0;Y<F.length;++Y)j+=F[Y].length;const te=c.allocUnsafe(j);let ue=0;for(Y=0;Y<F.length;++Y){let pe=F[Y];if(nt(pe,Uint8Array))ue+pe.length>te.length?(c.isBuffer(pe)||(pe=c.from(pe)),pe.copy(te,ue)):Uint8Array.prototype.set.call(te,pe,ue);else if(c.isBuffer(pe))pe.copy(te,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=pe.length}return te};function ye(K,F){if(c.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||nt(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);const j=K.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&j===0)return 0;let te=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":return ct(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j*2;case"hex":return j>>>1;case"base64":return Et(K).length;default:if(te)return Y?-1:ct(K).length;F=(""+F).toLowerCase(),te=!0}}c.byteLength=ye;function Q(K,F,j){let Y=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((j===void 0||j>this.length)&&(j=this.length),j<=0)||(j>>>=0,F>>>=0,j<=F))return"";for(K||(K="utf8");;)switch(K){case"hex":return Ye(this,F,j);case"utf8":case"utf-8":return ge(this,F,j);case"ascii":return Le(this,F,j);case"latin1":case"binary":return Fe(this,F,j);case"base64":return be(this,F,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ft(this,F,j);default:if(Y)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),Y=!0}}c.prototype._isBuffer=!0;function ae(K,F,j){const Y=K[F];K[F]=K[j],K[j]=Y}c.prototype.swap16=function(){const F=this.length;if(F%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let j=0;j<F;j+=2)ae(this,j,j+1);return this},c.prototype.swap32=function(){const F=this.length;if(F%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let j=0;j<F;j+=4)ae(this,j,j+3),ae(this,j+1,j+2);return this},c.prototype.swap64=function(){const F=this.length;if(F%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let j=0;j<F;j+=8)ae(this,j,j+7),ae(this,j+1,j+6),ae(this,j+2,j+5),ae(this,j+3,j+4);return this},c.prototype.toString=function(){const F=this.length;return F===0?"":arguments.length===0?ge(this,0,F):Q.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(F){if(!c.isBuffer(F))throw new TypeError("Argument must be a Buffer");return this===F?!0:c.compare(this,F)===0},c.prototype.inspect=function(){let F="";const j=O.INSPECT_MAX_BYTES;return F=this.toString("hex",0,j).replace(/(.{2})/g,"$1 ").trim(),this.length>j&&(F+=" ... "),"<Buffer "+F+">"},D&&(c.prototype[D]=c.prototype.inspect),c.prototype.compare=function(F,j,Y,te,ue){if(nt(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(j===void 0&&(j=0),Y===void 0&&(Y=F?F.length:0),te===void 0&&(te=0),ue===void 0&&(ue=this.length),j<0||Y>F.length||te<0||ue>this.length)throw new RangeError("out of range index");if(te>=ue&&j>=Y)return 0;if(te>=ue)return-1;if(j>=Y)return 1;if(j>>>=0,Y>>>=0,te>>>=0,ue>>>=0,this===F)return 0;let pe=ue-te,Ie=Y-j;const qe=Math.min(pe,Ie),De=this.slice(te,ue),Ue=F.slice(j,Y);for(let Ae=0;Ae<qe;++Ae)if(De[Ae]!==Ue[Ae]){pe=De[Ae],Ie=Ue[Ae];break}return pe<Ie?-1:Ie<pe?1:0};function he(K,F,j,Y,te){if(K.length===0)return-1;if(typeof j=="string"?(Y=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,on(j)&&(j=te?0:K.length-1),j<0&&(j=K.length+j),j>=K.length){if(te)return-1;j=K.length-1}else if(j<0)if(te)j=0;else return-1;if(typeof F=="string"&&(F=c.from(F,Y)),c.isBuffer(F))return F.length===0?-1:se(K,F,j,Y,te);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(K,F,j):Uint8Array.prototype.lastIndexOf.call(K,F,j):se(K,[F],j,Y,te);throw new TypeError("val must be string, number or Buffer")}function se(K,F,j,Y,te){let ue=1,pe=K.length,Ie=F.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(K.length<2||F.length<2)return-1;ue=2,pe/=2,Ie/=2,j/=2}function qe(Ue,Ae){return ue===1?Ue[Ae]:Ue.readUInt16BE(Ae*ue)}let De;if(te){let Ue=-1;for(De=j;De<pe;De++)if(qe(K,De)===qe(F,Ue===-1?0:De-Ue)){if(Ue===-1&&(Ue=De),De-Ue+1===Ie)return Ue*ue}else Ue!==-1&&(De-=De-Ue),Ue=-1}else for(j+Ie>pe&&(j=pe-Ie),De=j;De>=0;De--){let Ue=!0;for(let Ae=0;Ae<Ie;Ae++)if(qe(K,De+Ae)!==qe(F,Ae)){Ue=!1;break}if(Ue)return De}return-1}c.prototype.includes=function(F,j,Y){return this.indexOf(F,j,Y)!==-1},c.prototype.indexOf=function(F,j,Y){return he(this,F,j,Y,!0)},c.prototype.lastIndexOf=function(F,j,Y){return he(this,F,j,Y,!1)};function fe(K,F,j,Y){j=Number(j)||0;const te=K.length-j;Y?(Y=Number(Y),Y>te&&(Y=te)):Y=te;const ue=F.length;Y>ue/2&&(Y=ue/2);let pe;for(pe=0;pe<Y;++pe){const Ie=parseInt(F.substr(pe*2,2),16);if(on(Ie))return pe;K[j+pe]=Ie}return pe}function me(K,F,j,Y){return Rt(ct(F,K.length-j),K,j,Y)}function ee(K,F,j,Y){return Rt(mt(F),K,j,Y)}function le(K,F,j,Y){return Rt(Et(F),K,j,Y)}function ve(K,F,j,Y){return Rt(rn(F,K.length-j),K,j,Y)}c.prototype.write=function(F,j,Y,te){if(j===void 0)te="utf8",Y=this.length,j=0;else if(Y===void 0&&typeof j=="string")te=j,Y=this.length,j=0;else if(isFinite(j))j=j>>>0,isFinite(Y)?(Y=Y>>>0,te===void 0&&(te="utf8")):(te=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-j;if((Y===void 0||Y>ue)&&(Y=ue),F.length>0&&(Y<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let pe=!1;for(;;)switch(te){case"hex":return fe(this,F,j,Y);case"utf8":case"utf-8":return me(this,F,j,Y);case"ascii":case"latin1":case"binary":return ee(this,F,j,Y);case"base64":return le(this,F,j,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,F,j,Y);default:if(pe)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),pe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function be(K,F,j){return F===0&&j===K.length?N.fromByteArray(K):N.fromByteArray(K.slice(F,j))}function ge(K,F,j){j=Math.min(K.length,j);const Y=[];let te=F;for(;te<j;){const ue=K[te];let pe=null,Ie=ue>239?4:ue>223?3:ue>191?2:1;if(te+Ie<=j){let qe,De,Ue,Ae;switch(Ie){case 1:ue<128&&(pe=ue);break;case 2:qe=K[te+1],(qe&192)===128&&(Ae=(ue&31)<<6|qe&63,Ae>127&&(pe=Ae));break;case 3:qe=K[te+1],De=K[te+2],(qe&192)===128&&(De&192)===128&&(Ae=(ue&15)<<12|(qe&63)<<6|De&63,Ae>2047&&(Ae<55296||Ae>57343)&&(pe=Ae));break;case 4:qe=K[te+1],De=K[te+2],Ue=K[te+3],(qe&192)===128&&(De&192)===128&&(Ue&192)===128&&(Ae=(ue&15)<<18|(qe&63)<<12|(De&63)<<6|Ue&63,Ae>65535&&Ae<1114112&&(pe=Ae))}}pe===null?(pe=65533,Ie=1):pe>65535&&(pe-=65536,Y.push(pe>>>10&1023|55296),pe=56320|pe&1023),Y.push(pe),te+=Ie}return Ne(Y)}const $e=4096;function Ne(K){const F=K.length;if(F<=$e)return String.fromCharCode.apply(String,K);let j="",Y=0;for(;Y<F;)j+=String.fromCharCode.apply(String,K.slice(Y,Y+=$e));return j}function Le(K,F,j){let Y="";j=Math.min(K.length,j);for(let te=F;te<j;++te)Y+=String.fromCharCode(K[te]&127);return Y}function Fe(K,F,j){let Y="";j=Math.min(K.length,j);for(let te=F;te<j;++te)Y+=String.fromCharCode(K[te]);return Y}function Ye(K,F,j){const Y=K.length;(!F||F<0)&&(F=0),(!j||j<0||j>Y)&&(j=Y);let te="";for(let ue=F;ue<j;++ue)te+=sn[K[ue]];return te}function ft(K,F,j){const Y=K.slice(F,j);let te="";for(let ue=0;ue<Y.length-1;ue+=2)te+=String.fromCharCode(Y[ue]+Y[ue+1]*256);return te}c.prototype.slice=function(F,j){const Y=this.length;F=~~F,j=j===void 0?Y:~~j,F<0?(F+=Y,F<0&&(F=0)):F>Y&&(F=Y),j<0?(j+=Y,j<0&&(j=0)):j>Y&&(j=Y),j<F&&(j=F);const te=this.subarray(F,j);return Object.setPrototypeOf(te,c.prototype),te};function Re(K,F,j){if(K%1!==0||K<0)throw new RangeError("offset is not uint");if(K+F>j)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(F,j,Y){F=F>>>0,j=j>>>0,Y||Re(F,j,this.length);let te=this[F],ue=1,pe=0;for(;++pe<j&&(ue*=256);)te+=this[F+pe]*ue;return te},c.prototype.readUintBE=c.prototype.readUIntBE=function(F,j,Y){F=F>>>0,j=j>>>0,Y||Re(F,j,this.length);let te=this[F+--j],ue=1;for(;j>0&&(ue*=256);)te+=this[F+--j]*ue;return te},c.prototype.readUint8=c.prototype.readUInt8=function(F,j){return F=F>>>0,j||Re(F,1,this.length),this[F]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(F,j){return F=F>>>0,j||Re(F,2,this.length),this[F]|this[F+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(F,j){return F=F>>>0,j||Re(F,2,this.length),this[F]<<8|this[F+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},c.prototype.readBigUInt64LE=yt(function(F){F=F>>>0,Ce(F,"offset");const j=this[F],Y=this[F+7];(j===void 0||Y===void 0)&&je(F,this.length-8);const te=j+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,ue=this[++F]+this[++F]*2**8+this[++F]*2**16+Y*2**24;return BigInt(te)+(BigInt(ue)<<BigInt(32))}),c.prototype.readBigUInt64BE=yt(function(F){F=F>>>0,Ce(F,"offset");const j=this[F],Y=this[F+7];(j===void 0||Y===void 0)&&je(F,this.length-8);const te=j*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],ue=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+Y;return(BigInt(te)<<BigInt(32))+BigInt(ue)}),c.prototype.readIntLE=function(F,j,Y){F=F>>>0,j=j>>>0,Y||Re(F,j,this.length);let te=this[F],ue=1,pe=0;for(;++pe<j&&(ue*=256);)te+=this[F+pe]*ue;return ue*=128,te>=ue&&(te-=Math.pow(2,8*j)),te},c.prototype.readIntBE=function(F,j,Y){F=F>>>0,j=j>>>0,Y||Re(F,j,this.length);let te=j,ue=1,pe=this[F+--te];for(;te>0&&(ue*=256);)pe+=this[F+--te]*ue;return ue*=128,pe>=ue&&(pe-=Math.pow(2,8*j)),pe},c.prototype.readInt8=function(F,j){return F=F>>>0,j||Re(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},c.prototype.readInt16LE=function(F,j){F=F>>>0,j||Re(F,2,this.length);const Y=this[F]|this[F+1]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt16BE=function(F,j){F=F>>>0,j||Re(F,2,this.length);const Y=this[F+1]|this[F]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt32LE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},c.prototype.readInt32BE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},c.prototype.readBigInt64LE=yt(function(F){F=F>>>0,Ce(F,"offset");const j=this[F],Y=this[F+7];(j===void 0||Y===void 0)&&je(F,this.length-8);const te=this[F+4]+this[F+5]*2**8+this[F+6]*2**16+(Y<<24);return(BigInt(te)<<BigInt(32))+BigInt(j+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24)}),c.prototype.readBigInt64BE=yt(function(F){F=F>>>0,Ce(F,"offset");const j=this[F],Y=this[F+7];(j===void 0||Y===void 0)&&je(F,this.length-8);const te=(j<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(te)<<BigInt(32))+BigInt(this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+Y)}),c.prototype.readFloatLE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),I.read(this,F,!0,23,4)},c.prototype.readFloatBE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),I.read(this,F,!1,23,4)},c.prototype.readDoubleLE=function(F,j){return F=F>>>0,j||Re(F,8,this.length),I.read(this,F,!0,52,8)},c.prototype.readDoubleBE=function(F,j){return F=F>>>0,j||Re(F,8,this.length),I.read(this,F,!1,52,8)};function xe(K,F,j,Y,te,ue){if(!c.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>te||F<ue)throw new RangeError('"value" argument is out of bounds');if(j+Y>K.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(F,j,Y,te){if(F=+F,j=j>>>0,Y=Y>>>0,!te){const Ie=Math.pow(2,8*Y)-1;xe(this,F,j,Y,Ie,0)}let ue=1,pe=0;for(this[j]=F&255;++pe<Y&&(ue*=256);)this[j+pe]=F/ue&255;return j+Y},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(F,j,Y,te){if(F=+F,j=j>>>0,Y=Y>>>0,!te){const Ie=Math.pow(2,8*Y)-1;xe(this,F,j,Y,Ie,0)}let ue=Y-1,pe=1;for(this[j+ue]=F&255;--ue>=0&&(pe*=256);)this[j+ue]=F/pe&255;return j+Y},c.prototype.writeUint8=c.prototype.writeUInt8=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,1,255,0),this[j]=F&255,j+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,2,65535,0),this[j]=F&255,this[j+1]=F>>>8,j+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,2,65535,0),this[j]=F>>>8,this[j+1]=F&255,j+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,4,4294967295,0),this[j+3]=F>>>24,this[j+2]=F>>>16,this[j+1]=F>>>8,this[j]=F&255,j+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,4,4294967295,0),this[j]=F>>>24,this[j+1]=F>>>16,this[j+2]=F>>>8,this[j+3]=F&255,j+4};function ot(K,F,j,Y,te){Oe(F,Y,te,K,j,7);let ue=Number(F&BigInt(4294967295));K[j++]=ue,ue=ue>>8,K[j++]=ue,ue=ue>>8,K[j++]=ue,ue=ue>>8,K[j++]=ue;let pe=Number(F>>BigInt(32)&BigInt(4294967295));return K[j++]=pe,pe=pe>>8,K[j++]=pe,pe=pe>>8,K[j++]=pe,pe=pe>>8,K[j++]=pe,j}function Pe(K,F,j,Y,te){Oe(F,Y,te,K,j,7);let ue=Number(F&BigInt(4294967295));K[j+7]=ue,ue=ue>>8,K[j+6]=ue,ue=ue>>8,K[j+5]=ue,ue=ue>>8,K[j+4]=ue;let pe=Number(F>>BigInt(32)&BigInt(4294967295));return K[j+3]=pe,pe=pe>>8,K[j+2]=pe,pe=pe>>8,K[j+1]=pe,pe=pe>>8,K[j]=pe,j+8}c.prototype.writeBigUInt64LE=yt(function(F,j=0){return ot(this,F,j,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=yt(function(F,j=0){return Pe(this,F,j,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(F,j,Y,te){if(F=+F,j=j>>>0,!te){const qe=Math.pow(2,8*Y-1);xe(this,F,j,Y,qe-1,-qe)}let ue=0,pe=1,Ie=0;for(this[j]=F&255;++ue<Y&&(pe*=256);)F<0&&Ie===0&&this[j+ue-1]!==0&&(Ie=1),this[j+ue]=(F/pe>>0)-Ie&255;return j+Y},c.prototype.writeIntBE=function(F,j,Y,te){if(F=+F,j=j>>>0,!te){const qe=Math.pow(2,8*Y-1);xe(this,F,j,Y,qe-1,-qe)}let ue=Y-1,pe=1,Ie=0;for(this[j+ue]=F&255;--ue>=0&&(pe*=256);)F<0&&Ie===0&&this[j+ue+1]!==0&&(Ie=1),this[j+ue]=(F/pe>>0)-Ie&255;return j+Y},c.prototype.writeInt8=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,1,127,-128),F<0&&(F=255+F+1),this[j]=F&255,j+1},c.prototype.writeInt16LE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,2,32767,-32768),this[j]=F&255,this[j+1]=F>>>8,j+2},c.prototype.writeInt16BE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,2,32767,-32768),this[j]=F>>>8,this[j+1]=F&255,j+2},c.prototype.writeInt32LE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,4,2147483647,-2147483648),this[j]=F&255,this[j+1]=F>>>8,this[j+2]=F>>>16,this[j+3]=F>>>24,j+4},c.prototype.writeInt32BE=function(F,j,Y){return F=+F,j=j>>>0,Y||xe(this,F,j,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[j]=F>>>24,this[j+1]=F>>>16,this[j+2]=F>>>8,this[j+3]=F&255,j+4},c.prototype.writeBigInt64LE=yt(function(F,j=0){return ot(this,F,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=yt(function(F,j=0){return Pe(this,F,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Xe(K,F,j,Y,te,ue){if(j+Y>K.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function at(K,F,j,Y,te){return F=+F,j=j>>>0,te||Xe(K,F,j,4),I.write(K,F,j,Y,23,4),j+4}c.prototype.writeFloatLE=function(F,j,Y){return at(this,F,j,!0,Y)},c.prototype.writeFloatBE=function(F,j,Y){return at(this,F,j,!1,Y)};function Qe(K,F,j,Y,te){return F=+F,j=j>>>0,te||Xe(K,F,j,8),I.write(K,F,j,Y,52,8),j+8}c.prototype.writeDoubleLE=function(F,j,Y){return Qe(this,F,j,!0,Y)},c.prototype.writeDoubleBE=function(F,j,Y){return Qe(this,F,j,!1,Y)},c.prototype.copy=function(F,j,Y,te){if(!c.isBuffer(F))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!te&&te!==0&&(te=this.length),j>=F.length&&(j=F.length),j||(j=0),te>0&&te<Y&&(te=Y),te===Y||F.length===0||this.length===0)return 0;if(j<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),F.length-j<te-Y&&(te=F.length-j+Y);const ue=te-Y;return this===F&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(j,Y,te):Uint8Array.prototype.set.call(F,this.subarray(Y,te),j),ue},c.prototype.fill=function(F,j,Y,te){if(typeof F=="string"){if(typeof j=="string"?(te=j,j=0,Y=this.length):typeof Y=="string"&&(te=Y,Y=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!c.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(F.length===1){const pe=F.charCodeAt(0);(te==="utf8"&&pe<128||te==="latin1")&&(F=pe)}}else typeof F=="number"?F=F&255:typeof F=="boolean"&&(F=Number(F));if(j<0||this.length<j||this.length<Y)throw new RangeError("Out of range index");if(Y<=j)return this;j=j>>>0,Y=Y===void 0?this.length:Y>>>0,F||(F=0);let ue;if(typeof F=="number")for(ue=j;ue<Y;++ue)this[ue]=F;else{const pe=c.isBuffer(F)?F:c.from(F,te),Ie=pe.length;if(Ie===0)throw new TypeError('The value "'+F+'" is invalid for argument "value"');for(ue=0;ue<Y-j;++ue)this[ue+j]=pe[ue%Ie]}return this};const He={};function Se(K,F,j){He[K]=class extends j{constructor(){super(),Object.defineProperty(this,"message",{value:F.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${K}]`,this.stack,delete this.name}get code(){return K}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${K}]: ${this.message}`}}}Se("ERR_BUFFER_OUT_OF_BOUNDS",function(K){return K?`${K} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Se("ERR_INVALID_ARG_TYPE",function(K,F){return`The "${K}" argument must be of type number. Received type ${typeof F}`},TypeError),Se("ERR_OUT_OF_RANGE",function(K,F,j){let Y=`The value of "${K}" is out of range.`,te=j;return Number.isInteger(j)&&Math.abs(j)>2**32?te=ke(String(j)):typeof j=="bigint"&&(te=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(te=ke(te)),te+="n"),Y+=` It must be ${F}. Received ${te}`,Y},RangeError);function ke(K){let F="",j=K.length;const Y=K[0]==="-"?1:0;for(;j>=Y+4;j-=3)F=`_${K.slice(j-3,j)}${F}`;return`${K.slice(0,j)}${F}`}function Te(K,F,j){Ce(F,"offset"),(K[F]===void 0||K[F+j]===void 0)&&je(F,K.length-(j+1))}function Oe(K,F,j,Y,te,ue){if(K>j||K<F){const pe=typeof F=="bigint"?"n":"";let Ie;throw F===0||F===BigInt(0)?Ie=`>= 0${pe} and < 2${pe} ** ${(ue+1)*8}${pe}`:Ie=`>= -(2${pe} ** ${(ue+1)*8-1}${pe}) and < 2 ** ${(ue+1)*8-1}${pe}`,new He.ERR_OUT_OF_RANGE("value",Ie,K)}Te(Y,te,ue)}function Ce(K,F){if(typeof K!="number")throw new He.ERR_INVALID_ARG_TYPE(F,"number",K)}function je(K,F,j){throw Math.floor(K)!==K?(Ce(K,j),new He.ERR_OUT_OF_RANGE("offset","an integer",K)):F<0?new He.ERR_BUFFER_OUT_OF_BOUNDS:new He.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,K)}const Ve=/[^+/0-9A-Za-z-_]/g;function Je(K){if(K=K.split("=")[0],K=K.trim().replace(Ve,""),K.length<2)return"";for(;K.length%4!==0;)K=K+"=";return K}function ct(K,F){F=F||1/0;let j;const Y=K.length;let te=null;const ue=[];for(let pe=0;pe<Y;++pe){if(j=K.charCodeAt(pe),j>55295&&j<57344){if(!te){if(j>56319){(F-=3)>-1&&ue.push(239,191,189);continue}else if(pe+1===Y){(F-=3)>-1&&ue.push(239,191,189);continue}te=j;continue}if(j<56320){(F-=3)>-1&&ue.push(239,191,189),te=j;continue}j=(te-55296<<10|j-56320)+65536}else te&&(F-=3)>-1&&ue.push(239,191,189);if(te=null,j<128){if((F-=1)<0)break;ue.push(j)}else if(j<2048){if((F-=2)<0)break;ue.push(j>>6|192,j&63|128)}else if(j<65536){if((F-=3)<0)break;ue.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((F-=4)<0)break;ue.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return ue}function mt(K){const F=[];for(let j=0;j<K.length;++j)F.push(K.charCodeAt(j)&255);return F}function rn(K,F){let j,Y,te;const ue=[];for(let pe=0;pe<K.length&&!((F-=2)<0);++pe)j=K.charCodeAt(pe),Y=j>>8,te=j%256,ue.push(te),ue.push(Y);return ue}function Et(K){return N.toByteArray(Je(K))}function Rt(K,F,j,Y){let te;for(te=0;te<Y&&!(te+j>=F.length||te>=K.length);++te)F[te+j]=K[te];return te}function nt(K,F){return K instanceof F||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===F.name}function on(K){return K!==K}const sn=function(){const K="0123456789abcdef",F=new Array(256);for(let j=0;j<16;++j){const Y=j*16;for(let te=0;te<16;++te)F[Y+te]=K[j]+K[te]}return F}();function yt(K){return typeof BigInt>"u"?ln:K}function ln(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var O=toolsEbml&&toolsEbml.__assign||function(){return O=Object.assign||function(f){for(var k,i=1,c=arguments.length;i<c;i++){k=arguments[i];for(var $ in k)Object.prototype.hasOwnProperty.call(k,$)&&(f[$]=k[$])}return f},O.apply(this,arguments)},N=toolsEbml&&toolsEbml.__spreadArray||function(f,k,i){if(i||arguments.length===2)for(var c=0,$=k.length,C;c<$;c++)(C||!(c in k))&&(C||(C=Array.prototype.slice.call(k,0,c)),C[c]=k[c]);return f.concat(C||Array.prototype.slice.call(k))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var I=requireTools(),D=function(){function f(){}return f.readVint=function(k,i){i===void 0&&(i=0);var c=8-Math.floor(Math.log2(k[i]));if(c>8){var $=f.readHexString(k,i,i+c);throw new Error("Unrepresentable length: ".concat(c," ").concat($))}if(i+c>k.length)return null;for(var C=k[i]&(1<<8-c)-1,M=1;M<c;M+=1){if(M===7&&C>=Math.pow(2,8)&&k[i+7]>0)return{length:c,value:-1};C*=Math.pow(2,8),C+=k[i+M]}return{length:c,value:C}},f.writeVint=function(k){if(k<0||k>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(k));var i=1;for(i=1;i<=8&&!(k<Math.pow(2,7*i)-1);i+=1);for(var c=I.Buffer.alloc(i),$=k,C=1;C<=i;C+=1){var M=$&255;c[i-C]=M,$-=M,$/=Math.pow(2,8)}return c[0]|=1<<8-i,c},f.concatenate=function(k,i){return!k&&!i?I.Buffer.from([]):!k||k.byteLength===0?i:!i||i.byteLength===0?k:I.Buffer.from(N(N([],k,!0),i,!0))},f.readHexString=function(k,i,c){return i===void 0&&(i=0),c===void 0&&(c=k.byteLength),Array.from(k.slice(i,c)).map(function($){return Number($).toString(16)}).reduce(function($,C){return"".concat($).concat(C.padStart(2,"0"))},"")},f.readUtf8=function(k){try{return I.Buffer.from(k).toString("utf8")}catch{return null}},f.readUnsigned=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return k.byteLength<=6?k.reduce(function(c,$){return c*256+$},0):f.readHexString(k,0,k.byteLength)},f.readSigned=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},f.readFloat=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},f.readDate=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(f.readHexString(k),16));default:return new Date(0)}},f.readDataFromTag=function(k,i){var c=k.type,$=k.name,C=k.track,M=k.discardable||!1,J=k.keyframe||!1,Z=null,z;switch(c){case"u":z=f.readUnsigned(i);break;case"f":z=f.readFloat(i);break;case"i":z=f.readSigned(i);break;case"s":z=String.fromCharCode.apply(String,i);break;case"8":z=f.readUtf8(i);break;case"d":z=f.readDate(i);break}if($==="SimpleBlock"||$==="Block"){var X=0,re=f.readVint(i,X),oe=re.length,ne=re.value;X+=oe,C=ne,z=f.readSigned(i.subarray(X,X+2)),X+=2,$==="SimpleBlock"&&(J=!!(i[oe+2]&128),M=!!(i[oe+2]&1)),X+=1,Z=i.subarray(X)}return O(O({},k),{data:i,discardable:M,keyframe:J,payload:Z,track:C,value:z})},f}();return toolsEbml.default=D,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(O,N,I){N=N||0;for(var D=1;D<=8&&!(O[N]>=Math.pow(2,8-D));D++);if(D>8)throw new Error("Unrepresentable length: "+D+" "+O.toString("hex",N,N+D));if(N+D>O.length)return null;var f,k=O[N]&(1<<8-D)-1;for(f=1;f<D;f++){if(f===7&&k>=Math.pow(2,45)&&O[N+7]>0)return{length:D,value:-1};k*=Math.pow(2,8),k+=O[N+f]}return I&&(k-=Math.pow(2,D*7-1)-1),{length:D,value:k}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var O=requireVint();function N(I){this.buffer=I,this.offset=0}return N.prototype.nextInt16BE=function(){var I=this.buffer.readInt16BE(this.offset);return this.offset+=2,I},N.prototype.nextUInt8=function(){var I=this.buffer.readUInt8(this.offset);return this.offset+=1,I},N.prototype.nextUIntV=function(){var I=O(this.buffer,this.offset);return this.offset+=I.length,I.value},N.prototype.nextIntV=function(){var I=O(this.buffer,this.offset,!0);return this.offset+=I.length,I.value},N.prototype.nextBuffer=function(I){var D=I?this.buffer.slice(this.offset,this.offset+I):this.buffer.slice(this.offset);return this.offset+=I||this.length,D},Object.defineProperty(N.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=N,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var O=requireBufferReader(),N=1,I=3,D=2;ebmlBlock=function(k){var i={},c=new O(k);i.trackNumber=c.nextUIntV(),i.timecode=c.nextInt16BE();var $=c.nextUInt8();i.invisible=!!($&8),i.keyframe=!!($&128),i.discardable=!!($&1);var C=($&6)>>1;return i.frames=f(c,C),i};function f(k,i){if(!i)return[k.nextBuffer()];var c,$,C=[],M=k.nextUInt8()+1;if(i===D){if(k.length%M!==0)throw new Error("Fixed-Size Lacing Error");for($=k.length/M,c=0;c<M;c++)C.push(k.nextBuffer($));return C}var J=[];if(i===N)for(c=0;c<M-1;c++){var Z;$=0;do Z=k.nextUInt8(),$+=Z;while(Z===255);J.push($)}else if(i===I)for($=k.nextUIntV(),J.push($),c=1;c<M-1;c++)$+=k.nextIntV(),J.push($);for(c=0;c<M-1;c++)C.push(k.nextBuffer(J[c]));return C.push(k.nextBuffer()),C}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(O){Object.defineProperty(O,"__esModule",{value:!0}),O.convertEBMLDateToJSDate=O.createFloatBuffer=O.createIntBuffer=O.createUIntBuffer=O.encodeValueToBuffer=O.concat=O.putRefinedMetaData=O.extractElement=O.removeElement=O.makeMetadataSeekable=O.createRIFFChunk=O.VP8BitStreamToRiffWebPBuffer=O.WebPBlockFilter=O.encodeTag=O.readBlock=O.ebmlBlock=O.writeVint=O.readVint=O.Buffer=void 0;var N=requireInt64Buffer(),I=requireEBMLEncoder(),D=requireBuffer(),f=requireToolsEbml(),k=requireEbmlBlock();O.Buffer=D.Buffer,O.readVint=f.default.readVint,O.writeVint=f.default.writeVint,O.ebmlBlock=k;function i(ee){return(0,O.ebmlBlock)(new O.Buffer(ee))}O.readBlock=i;function c(ee,le,ve){return ve===void 0&&(ve=!1),Q([ee,ve?new O.Buffer("01ffffffffffffff","hex"):(0,O.writeVint)(le.length),le])}O.encodeTag=c;function $(ee){return ee.reduce(function(le,ve){if(ve.type!=="b"||ve.name!=="SimpleBlock")return le;var be=(0,O.ebmlBlock)(ve.data),ge=be.frames.some(function($e){var Ne=$e.slice(3,6).toString("hex");return Ne==="9d012a"});return ge?le.concat(ve):le},[])}O.WebPBlockFilter=$;function C(ee){var le=M("VP8 ",ee),ve=Q([new O.Buffer("WEBP","ascii"),le]);return M("RIFF",ve)}O.VP8BitStreamToRiffWebPBuffer=C;function M(ee,le){var ve=new O.Buffer(4);return ve.writeUInt32LE(le.byteLength,0),Q([new O.Buffer(ee.substr(0,4),"ascii"),ve,le,new O.Buffer(le.byteLength%2===0?0:1)])}O.createRIFFChunk=M;function J(ee,le,ve){var be=z("EBML",ee),ge=re(be),$e=ge+12,Ne=ee[ee.length-1].dataEnd-$e,Le=z("Info",ee);Z("Duration",Le),Le.splice(1,0,{name:"Duration",type:"f",data:fe(le,8)});for(var Fe=re(Le),Ye=z("Tracks",ee),ft=re(Ye),Re=47,xe=[],ot=5+ve.length*15,Pe=[],Xe=-1,at=10,Qe=function(Oe){var Ce=Re,je=Ce+Fe,Ve=je+ft,Je=Ve+ot,ct=Je-Ne;if(xe=[],xe.push({name:"SeekHead",type:"m",isEnd:!1}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([21,73,169,102])}),xe.push({name:"SeekPosition",type:"u",data:he(Ce)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([22,84,174,107])}),xe.push({name:"SeekPosition",type:"u",data:he(je)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([28,83,187,107])}),xe.push({name:"SeekPosition",type:"u",data:he(Ve)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"SeekHead",type:"m",isEnd:!0}),Re=re(xe),Pe=[],Pe.push({name:"Cues",type:"m",isEnd:!1}),ve.forEach(function(mt){var rn=mt.CueTrack,Et=mt.CueClusterPosition,Rt=mt.CueTime;Pe.push({name:"CuePoint",type:"m",isEnd:!1}),Pe.push({name:"CueTime",type:"u",data:he(Rt)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Pe.push({name:"CueTrack",type:"u",data:he(rn)}),Et-=$e,Et+=ct,Pe.push({name:"CueClusterPosition",type:"u",data:he(Et)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Pe.push({name:"CuePoint",type:"m",isEnd:!0})}),Pe.push({name:"Cues",type:"m",isEnd:!0}),ot=re(Pe),Xe!==ct){if(Xe=ct,Oe===at-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},He=0;He<at;He++){var Se=Qe(He);if(Se==="break")break}var ke=[].concat.apply([],[be,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},xe,Le,Ye,Pe]),Te=new I.default().encode(ke);return Te}O.makeMetadataSeekable=J;function Z(ee,le){for(var ve=-1,be=0;be<le.length;be++){var ge=le[be];if(ge.name===ee)if(ge.type==="m")if(!ge.isEnd)ve=be;else{if(ve==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));le.splice(ve,be-ve+1);return}else{le.splice(be,1);return}}}O.removeElement=Z;function z(ee,le){for(var ve=[],be=-1,ge=0;ge<le.length;ge++){var $e=le[ge];if($e.name===ee)if($e.type==="m")if(!$e.isEnd)be=ge;else{if(be==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));ve=le.slice(be,ge+1);break}else{ve.push(le[ge]);break}}return ve}O.extractElement=z;function X(ee,le){Array.isArray(le.cueInfos)&&!Array.isArray(le.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),le.cues=le.cueInfos);for(var ve=[],be=[],ge=0;ge<ee.length;ge++){var $e=ee[ge];if($e.type==="m"&&$e.name==="Segment"){if(ve=ee.slice(0,ge),be=ee.slice(ge),$e.unknownSize){be.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(be[be.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ne=be[be.length-1].dataEnd,Le=ve[ve.length-1].dataEnd,Fe=new I.default().encode(ve).byteLength,Ye=Fe-Le,ft=Ne-be[0].tagStart;be[0].tagStart-Le,be[0].tagStart;var Re=new O.Buffer([24,83,128,103]),xe=new O.Buffer("01ffffffffffffff","hex"),ot=Re.byteLength+xe.byteLength,Pe=ft,Xe;for(Xe=1;Xe<20;Xe++){var at=Le+ot+Pe,Qe=at-Ne,He=Ye+Qe,Se=oe(be,He,le),ke=new I.default().encode(Se).byteLength;if(ke===Pe)return new I.default().encode([].concat(ve,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],Se));Pe=ke}throw new Error("unable to refine metadata, stable size could not be found in "+Xe+" iterations!")}O.putRefinedMetaData=X;function re(ee){var le=new I.default;return ee.reduce(function(ve,be){return ve.concat(le.encode([be]))},[]).reduce(function(ve,be){return ve+be.byteLength},0)}function oe(ee,le,ve){var be=ve.duration,ge=ve.clusterPtrs,$e=ve.cues,Ne=ee.slice(0);if(typeof be=="number"){var Le=!1;Ne.forEach(function(Ye){Ye.type==="f"&&Ye.name==="Duration"&&(Le=!0,Ye.data=fe(be,8))}),Le||ye(Ne,"Info",[{name:"Duration",type:"f",data:fe(be,8)}])}Array.isArray($e)&&ye(Ne,"Cues",de($e,le));var Fe=[];return Array.isArray(ge)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Fe=ne(ge,le)),ye(Ne,"SeekHead",Fe,!0),Ne}function ne(ee,le){var ve=[];return ee.forEach(function(be){ve.push({name:"Seek",type:"m",isEnd:!1}),ve.push({name:"SeekID",type:"b",data:new O.Buffer([31,67,182,117])}),ve.push({name:"SeekPosition",type:"u",data:he(be+le)}),ve.push({name:"Seek",type:"m",isEnd:!0})}),ve}function de(ee,le){var ve=[];return ee.forEach(function(be){var ge=be.CueTrack,$e=be.CueClusterPosition,Ne=be.CueTime;ve.push({name:"CuePoint",type:"m",isEnd:!1}),ve.push({name:"CueTime",type:"u",data:he(Ne)}),ve.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ve.push({name:"CueTrack",type:"u",data:he(ge)}),ve.push({name:"CueClusterPosition",type:"u",data:he($e+le)}),ve.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ve.push({name:"CuePoint",type:"m",isEnd:!0})}),ve}function ye(ee,le,ve,be){be===void 0&&(be=!1);for(var ge=-1,$e=0;$e<ee.length;$e++){var Ne=ee[$e];if(Ne.type==="m"&&Ne.name===le&&Ne.isEnd===!1){ge=$e;break}}ge>=0?Array.prototype.splice.apply(ee,[ge+1,0].concat(ve)):be?[].concat([{name:le,type:"m",isEnd:!1}],ve,[{name:le,type:"m",isEnd:!0}]).reverse().forEach(function(Le){ee.unshift(Le)}):(ee.push({name:le,type:"m",isEnd:!1}),ve.forEach(function(Le){ee.push(Le)}),ee.push({name:le,type:"m",isEnd:!0}))}function Q(ee){return O.Buffer.concat(ee)}O.concat=Q;function ae(ee){var le=new O.Buffer(0);if(ee.type==="m")return ee;switch(ee.type){case"u":le=he(ee.value);break;case"i":le=se(ee.value);break;case"f":le=fe(ee.value);break;case"s":le=new O.Buffer(ee.value,"ascii");break;case"8":le=new O.Buffer(ee.value,"utf8");break;case"b":le=ee.value;break;case"d":le=new N.Int64BE(ee.value.getTime().toString()).toBuffer();break}return Object.assign({},ee,{data:le})}O.encodeValueToBuffer=ae;function he(ee){for(var le=1;ee>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new N.Uint64BE(ee).toBuffer();var ve=new O.Buffer(le);return ve.writeUIntBE(ee,0,le),ve}O.createUIntBuffer=he;function se(ee){for(var le=1;ee>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new N.Int64BE(ee).toBuffer();var ve=new O.Buffer(le);return ve.writeIntBE(ee,0,le),ve}O.createIntBuffer=se;function fe(ee,le){if(le===void 0&&(le=8),le===8){var ve=new O.Buffer(8);return ve.writeDoubleBE(ee,0),ve}else if(le===4){var ve=new O.Buffer(4);return ve.writeFloatBE(ee,0),ve}else throw new Error("float type bits must 4bytes or 8bytes")}O.createFloatBuffer=fe;function me(ee){return ee instanceof Date?ee:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ee)/1e3/1e3)}O.convertEBMLDateToJSDate=me}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var O=requireInt64Buffer(),N=requireTools(),I=requireTools(),D=requireEbmlID(),f;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(f||(f={}));var k=function(){function i(){this._buffer=new N.Buffer(0),this._tag_stack=[],this._state=f.STATE_TAG,this._cursor=0,this._total=0,this._schema=D.byEbmlID,this._result=[]}return i.prototype.decode=function(c){this.readChunk(c);var $=this._result;return this._result=[],$},i.prototype.readChunk=function(c){for(this._buffer=I.concat([this._buffer,new N.Buffer(c)]);this._cursor<this._buffer.length&&!(this._state===f.STATE_TAG&&!this.readTag()||this._state===f.STATE_SIZE&&!this.readSize()||this._state===f.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(c){return this._schema[c]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,N.readVint)(this._buffer,this._cursor);if(c==null)return!1;var $=this._buffer.slice(this._cursor,this._cursor+c.length),C=$.reduce(function(Z,z,X,re){return Z+z*Math.pow(16,2*(re.length-1-X))},0),M=this.getSchemaInfo(C),J={EBML_ID:C.toString(16),schema:M,type:M.type,name:M.name,level:M.level,tagStart:this._total,tagEnd:this._total+c.length,sizeStart:this._total+c.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(J),this._cursor+=c.length,this._total+=c.length,this._state=f.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,N.readVint)(this._buffer,this._cursor);if(c==null)return!1;var $=this._tag_stack[this._tag_stack.length-1];return $.sizeEnd=$.sizeStart+c.length,$.dataStart=$.sizeEnd,$.dataSize=c.value,c.value===-1?($.dataEnd=-1,$.type==="m"&&($.unknownSize=!0)):$.dataEnd=$.sizeEnd+c.value,this._cursor+=c.length,this._total+=c.length,this._state=f.STATE_CONTENT,!0},i.prototype.readContent=function(){var c=this._tag_stack[this._tag_stack.length-1];if(c.type==="m"){if(c.isEnd=!1,this._result.push(c),this._state=f.STATE_TAG,c.dataSize===0){var $=Object.assign({},c,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+c.dataSize)return!1;var C=this._buffer.slice(this._cursor,this._cursor+c.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+c.dataSize),c.data=C,c.type){case"u":c.value=C.readUIntBE(0,C.length);break;case"i":c.value=C.readIntBE(0,C.length);break;case"f":c.value=c.dataSize===4?C.readFloatBE(0):c.dataSize===8?C.readDoubleBE(0):(console.warn("cannot read ".concat(c.dataSize," octets float. failback to 0")),0);break;case"s":c.value=C.toString("ascii");break;case"8":c.value=C.toString("utf8");break;case"b":c.value=C;break;case"d":c.value=(0,N.convertEBMLDateToJSDate)(new O.Int64BE(C).toNumber());break}if(c.value===null)throw new Error("unknown tag type:"+c.type);for(this._result.push(c),this._total+=c.dataSize,this._state=f.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var M=this._tag_stack[this._tag_stack.length-1];if(M.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<M.dataEnd)break;if(M.type!=="m")throw new Error("parent element is not master element");var $=Object.assign({},M,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=k,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var O=typeof Reflect=="object"?Reflect:null,N=O&&typeof O.apply=="function"?O.apply:function(ae,he,se){return Function.prototype.apply.call(ae,he,se)},I;O&&typeof O.ownKeys=="function"?I=O.ownKeys:Object.getOwnPropertySymbols?I=function(ae){return Object.getOwnPropertyNames(ae).concat(Object.getOwnPropertySymbols(ae))}:I=function(ae){return Object.getOwnPropertyNames(ae)};function D(Q){console&&console.warn&&console.warn(Q)}var f=Number.isNaN||function(ae){return ae!==ae};function k(){k.init.call(this)}events.exports=k,events.exports.once=ne,k.EventEmitter=k,k.prototype._events=void 0,k.prototype._eventsCount=0,k.prototype._maxListeners=void 0;var i=10;function c(Q){if(typeof Q!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Q)}Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(Q){if(typeof Q!="number"||Q<0||f(Q))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Q+".");i=Q}}),k.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},k.prototype.setMaxListeners=function(ae){if(typeof ae!="number"||ae<0||f(ae))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ae+".");return this._maxListeners=ae,this};function $(Q){return Q._maxListeners===void 0?k.defaultMaxListeners:Q._maxListeners}k.prototype.getMaxListeners=function(){return $(this)},k.prototype.emit=function(ae){for(var he=[],se=1;se<arguments.length;se++)he.push(arguments[se]);var fe=ae==="error",me=this._events;if(me!==void 0)fe=fe&&me.error===void 0;else if(!fe)return!1;if(fe){var ee;if(he.length>0&&(ee=he[0]),ee instanceof Error)throw ee;var le=new Error("Unhandled error."+(ee?" ("+ee.message+")":""));throw le.context=ee,le}var ve=me[ae];if(ve===void 0)return!1;if(typeof ve=="function")N(ve,this,he);else for(var be=ve.length,ge=X(ve,be),se=0;se<be;++se)N(ge[se],this,he);return!0};function C(Q,ae,he,se){var fe,me,ee;if(c(he),me=Q._events,me===void 0?(me=Q._events=Object.create(null),Q._eventsCount=0):(me.newListener!==void 0&&(Q.emit("newListener",ae,he.listener?he.listener:he),me=Q._events),ee=me[ae]),ee===void 0)ee=me[ae]=he,++Q._eventsCount;else if(typeof ee=="function"?ee=me[ae]=se?[he,ee]:[ee,he]:se?ee.unshift(he):ee.push(he),fe=$(Q),fe>0&&ee.length>fe&&!ee.warned){ee.warned=!0;var le=new Error("Possible EventEmitter memory leak detected. "+ee.length+" "+String(ae)+" listeners added. Use emitter.setMaxListeners() to increase limit");le.name="MaxListenersExceededWarning",le.emitter=Q,le.type=ae,le.count=ee.length,D(le)}return Q}k.prototype.addListener=function(ae,he){return C(this,ae,he,!1)},k.prototype.on=k.prototype.addListener,k.prototype.prependListener=function(ae,he){return C(this,ae,he,!0)};function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function J(Q,ae,he){var se={fired:!1,wrapFn:void 0,target:Q,type:ae,listener:he},fe=M.bind(se);return fe.listener=he,se.wrapFn=fe,fe}k.prototype.once=function(ae,he){return c(he),this.on(ae,J(this,ae,he)),this},k.prototype.prependOnceListener=function(ae,he){return c(he),this.prependListener(ae,J(this,ae,he)),this},k.prototype.removeListener=function(ae,he){var se,fe,me,ee,le;if(c(he),fe=this._events,fe===void 0)return this;if(se=fe[ae],se===void 0)return this;if(se===he||se.listener===he)--this._eventsCount===0?this._events=Object.create(null):(delete fe[ae],fe.removeListener&&this.emit("removeListener",ae,se.listener||he));else if(typeof se!="function"){for(me=-1,ee=se.length-1;ee>=0;ee--)if(se[ee]===he||se[ee].listener===he){le=se[ee].listener,me=ee;break}if(me<0)return this;me===0?se.shift():re(se,me),se.length===1&&(fe[ae]=se[0]),fe.removeListener!==void 0&&this.emit("removeListener",ae,le||he)}return this},k.prototype.off=k.prototype.removeListener,k.prototype.removeAllListeners=function(ae){var he,se,fe;if(se=this._events,se===void 0)return this;if(se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):se[ae]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete se[ae]),this;if(arguments.length===0){var me=Object.keys(se),ee;for(fe=0;fe<me.length;++fe)ee=me[fe],ee!=="removeListener"&&this.removeAllListeners(ee);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(he=se[ae],typeof he=="function")this.removeListener(ae,he);else if(he!==void 0)for(fe=he.length-1;fe>=0;fe--)this.removeListener(ae,he[fe]);return this};function Z(Q,ae,he){var se=Q._events;if(se===void 0)return[];var fe=se[ae];return fe===void 0?[]:typeof fe=="function"?he?[fe.listener||fe]:[fe]:he?oe(fe):X(fe,fe.length)}k.prototype.listeners=function(ae){return Z(this,ae,!0)},k.prototype.rawListeners=function(ae){return Z(this,ae,!1)},k.listenerCount=function(Q,ae){return typeof Q.listenerCount=="function"?Q.listenerCount(ae):z.call(Q,ae)},k.prototype.listenerCount=z;function z(Q){var ae=this._events;if(ae!==void 0){var he=ae[Q];if(typeof he=="function")return 1;if(he!==void 0)return he.length}return 0}k.prototype.eventNames=function(){return this._eventsCount>0?I(this._events):[]};function X(Q,ae){for(var he=new Array(ae),se=0;se<ae;++se)he[se]=Q[se];return he}function re(Q,ae){for(;ae+1<Q.length;ae++)Q[ae]=Q[ae+1];Q.pop()}function oe(Q){for(var ae=new Array(Q.length),he=0;he<ae.length;++he)ae[he]=Q[he].listener||Q[he];return ae}function ne(Q,ae){return new Promise(function(he,se){function fe(ee){Q.removeListener(ae,me),se(ee)}function me(){typeof Q.removeListener=="function"&&Q.removeListener("error",fe),he([].slice.call(arguments))}ye(Q,ae,me,{once:!0}),ae!=="error"&&de(Q,fe,{once:!0})})}function de(Q,ae,he){typeof Q.on=="function"&&ye(Q,"error",ae,he)}function ye(Q,ae,he,se){if(typeof Q.on=="function")se.once?Q.once(ae,he):Q.on(ae,he);else if(typeof Q.addEventListener=="function")Q.addEventListener(ae,function fe(me){se.once&&Q.removeEventListener(ae,fe),he(me)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Q)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var O=EBMLReader&&EBMLReader.__extends||function(){var f=function(k,i){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,$){c.__proto__=$}||function(c,$){for(var C in $)Object.prototype.hasOwnProperty.call($,C)&&(c[C]=$[C])},f(k,i)};return function(k,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");f(k,i);function c(){this.constructor=k}k.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var N=requireEvents(),I=requireTools(),D=function(f){O(k,f);function k(){var i=f.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return k.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},k.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var C=this.lastClusterTimecode,M=this.duration,J=this.timecodeScale;this.emit("cluster",{timecode:C,data:i}),this.emit("duration",{timecodeScale:J,duration:M})}else{this.metadataloaded=!0,this.metadatas=i;var c=this.trackTypes.indexOf(1),$=this.trackTypes.indexOf(2);if(this.trackInfo=c>=0&&$>=0?{type:"both",trackNumber:c}:c>=0?{type:"video",trackNumber:c}:$>=0?{type:"audio",trackNumber:$}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},k.prototype.read=function(i){var c=this,$=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var C=this.stack[this.stack.length-1];if(C!=null&&C.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),C.dataEnd=i.dataEnd,C.dataSize=i.dataEnd-C.dataStart,C.unknownSize=!1;var M=Object.assign({},C,{name:C.name,type:C.type,isEnd:!0});this.chunks.push(M)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var J=I.ebmlBlock(i.data),Z=J.timecode,z=J.trackNumber,X=J.frames;if(this.trackTypes[z]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var re=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],Z]}else if(this.trackTypes[z]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var re=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],Z]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&X.forEach(function(oe){var ne=oe.slice(3,6).toString("hex");if(ne==="9d012a"){var de=I.VP8BitStreamToRiffWebPBuffer(oe),ye=new Blob([de],{type:"image/webp"}),Q=c.duration;c.emit("webp",{currentTime:Q,webp:ye})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),$=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),$||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(k.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,c=0,$=0,C=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof C=="number")i=C;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof M=="number"&&(c=M),$=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof M=="number"&&(c=M),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackInfo.trackNumber];typeof M=="number"&&(c=M),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackInfo.trackNumber];typeof M=="number"&&(c=M),$=this.last2SimpleBlockAudioTrackTimecode[1]}var J=(this.lastClusterTimecode+$)*this.timecodeScale+i-c,Z=J/this.timecodeScale;return Math.floor(Z)},enumerable:!1,configurable:!0}),k.prototype.addListener=function(i,c){return f.prototype.addListener.call(this,i,c)},k.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},k}(N.EventEmitter);return EBMLReader.default=D,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(O){var N=ebml&&ebml.__createBinding||(Object.create?function(c,$,C,M){M===void 0&&(M=C),Object.defineProperty(c,M,{enumerable:!0,get:function(){return $[C]}})}:function(c,$,C,M){M===void 0&&(M=C),c[M]=$[C]}),I=ebml&&ebml.__exportStar||function(c,$){for(var C in c)C!=="default"&&!Object.prototype.hasOwnProperty.call($,C)&&N($,c,C)};Object.defineProperty(O,"__esModule",{value:!0}),O.tools=O.Reader=O.Encoder=O.Decoder=void 0,I(requireEBML(),O);var D=requireEBMLDecoder();O.Decoder=D.default;var f=requireEBMLEncoder();O.Encoder=f.default;var k=requireEBMLReader();O.Reader=k.default;var i=requireTools();O.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var O=lib&&lib.__awaiter||function(f,k,i,c){function $(C){return C instanceof i?C:new i(function(M){M(C)})}return new(i||(i=Promise))(function(C,M){function J(X){try{z(c.next(X))}catch(re){M(re)}}function Z(X){try{z(c.throw(X))}catch(re){M(re)}}function z(X){X.done?C(X.value):$(X.value).then(J,Z)}z((c=c.apply(f,k||[])).next())})},N=lib&&lib.__generator||function(f,k){var i={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},c,$,C,M;return M={next:J(0),throw:J(1),return:J(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function J(z){return function(X){return Z([z,X])}}function Z(z){if(c)throw new TypeError("Generator is already executing.");for(;i;)try{if(c=1,$&&(C=z[0]&2?$.return:z[0]?$.throw||((C=$.return)&&C.call($),0):$.next)&&!(C=C.call($,z[1])).done)return C;switch($=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return i.label++,{value:z[1],done:!1};case 5:i.label++,$=z[1],z=[0];continue;case 7:z=i.ops.pop(),i.trys.pop();continue;default:if(C=i.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){i=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){i.label=z[1];break}if(z[0]===6&&i.label<C[1]){i.label=C[1],C=z;break}if(C&&i.label<C[2]){i.label=C[2],i.ops.push(z);break}C[2]&&i.ops.pop(),i.trys.pop();continue}z=k.call(f,i)}catch(X){z=[6,X],$=0}finally{c=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var I=requireEbml();function D(f){return O(this,void 0,void 0,function(){var k,i,c,$,C,M,J,Z,z,X,re,oe;return N(this,function(ne){switch(ne.label){case 0:if(!f)throw Error("call to fixWebmDuration requires a blob");k=new I.Decoder,i=new I.Reader,c=f.stream(),$=c.getReader(),ne.label=1;case 1:return[4,$.read()];case 2:return C=ne.sent(),M=C.done,J=C.value,M?(i.stop(),[3,3]):(Z=k.decode(J),Z=Z==null?void 0:Z.filter(function(de){return de.type!=="unknown"}),Z.forEach(function(de){i.read(de)}),J=null,[3,1]);case 3:return z=I.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),X=new Blob([z],{type:f.type}),re=f.slice(i.metadataSize),oe=new Blob([X,re],{type:f.type}),[2,oe]}})})}return lib.default=D,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){_e(this,We);_e(this,vt,!1);_e(this,st,!1);_e(this,At,0);_e(this,Bt,0);_e(this,et,0);_e(this,it,0);_e(this,bt,0);ie(this,"onchange",N=>{});ie(this,"onDurationChange",N=>{});ie(this,"start",async(N="")=>{N||(N=`video_Record_${E(Date.now())}`);let I=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(D=>{const f=D.getTracks();for(const i of f)i.onended=()=>this.stop();Be(this,vt,!0),Be(this,st,!1),Be(this,We,new MediaRecorder(D)),ce(this,We).start();const k=new Date().getTime();Be(this,At,k),Be(this,et,k),ce(this,_t).call(this),ce(this,Dt).call(this),ce(this,We).addEventListener("dataavailable",i=>{I.push(i.data)}),ce(this,We).addEventListener("stop",async()=>{Be(this,vt,!1);const i=new Date().getTime();Be(this,Bt,i),Be(this,it,ce(this,it)+(i-ce(this,et))),ce(this,_t).call(this),clearInterval(ce(this,bt));const c=D.getTracks();for(const Z of c)Z.stop();if(ce(this,We)===null)return;const $=new Blob(I,{type:ce(this,We).mimeType}),C=await fixWebmDuration($),M=URL.createObjectURL(C),J=document.createElement("a");J.href=M,J.download=`${N}.mp4`,J.click(),URL.revokeObjectURL(M),I=[],Be(this,We,null)})})});ie(this,"pause",async()=>{var I;await new Promise(D=>setTimeout(()=>D(!0),300)),(I=ce(this,We))==null||I.pause(),Be(this,st,!0);const N=new Date().getTime();Be(this,it,ce(this,it)+(N-ce(this,et))),ce(this,_t).call(this),clearInterval(ce(this,bt))});ie(this,"resume",async()=>{var I;(I=ce(this,We))==null||I.resume(),Be(this,st,!1);const N=new Date().getTime();Be(this,et,N),ce(this,_t).call(this),ce(this,Dt).call(this)});ie(this,"stop",async()=>{var N;(N=ce(this,We))==null||N.stop()});ie(this,"getDuration",()=>{if(ce(this,et)===0)return 0;let N=ce(this,it);const I=new Date().getTime();if(ce(this,vt)&&ce(this,st)===!1){const D=I-ce(this,et);Be(this,et,I),N=N+D}return N});ie(this,"getInfo",()=>({active:ce(this,vt),pause:ce(this,st),startTime:ce(this,At),endTime:ce(this,Bt),duration:ce(this,it)}));_e(this,_t,()=>{const N=this.getInfo();this.onchange(N)});_e(this,Dt,()=>{clearInterval(ce(this,bt)),Be(this,bt,window.setInterval(()=>{Be(this,it,this.getDuration()),this.onDurationChange(ce(this,it))},500))})}}We=new WeakMap,vt=new WeakMap,st=new WeakMap,At=new WeakMap,Bt=new WeakMap,et=new WeakMap,it=new WeakMap,bt=new WeakMap,_t=new WeakMap,Dt=new WeakMap;var l=Object.defineProperty,y=O=>{throw TypeError(O)},q=(O,N,I)=>N in O?l(O,N,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[N]=I,s=(O,N,I)=>q(O,typeof N!="symbol"?N+"":N,I),P=(O,N,I)=>N.has(O)||y("Cannot "+I),n=(O,N,I)=>(P(O,N,"read from private field"),I?I.call(O):N.get(O)),a=(O,N,I)=>N.has(O)?y("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(O):N.set(O,I),d,x,u;class p{constructor(N={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(I,D={})=>new Promise(async(f,k)=>{const i=D.timeout||this.options.timeout,c=D.key||n(this,d).call(this),$=D.describe||"";if(this.queue.findIndex(M=>M.key===c)!==-1)return k(`${c} is exist.`);const C={key:c,func:I,describe:$,timeout:i,resolve:f,reject:k};this.queue.unshift(C),this.activePromise||n(this,u).call(this)})),s(this,"clear",()=>{this.queue=[],clearTimeout(this.timer)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,x,I=>{const D=this.queue.findIndex(f=>f.key===I);this.queue.splice(D,1)}),a(this,u,async()=>{const I=this.queue.length;if(I===0)return;const D=I-1,f=this.queue[D];this.activePromise=f;const{key:k,func:i,resolve:c,reject:$,timeout:C}=this.activePromise;C&&(this.timer=window.setTimeout(()=>{$(`pr-async-queue: ${k} is timeout.`),n(this,u).call(this)},C)),await i().then(c).catch($).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,x).call(this,k),n(this,u).call(this)})}),this.options={timeout:0,...N}}}d=new WeakMap,x=new WeakMap,u=new WeakMap;class RoomBase{constructor(N){ie(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});ie(this,"sdk_service_version","1.0.6");ie(this,"prohibitNotify",!1);ie(this,"isEarly",!1);ie(this,"isInRoom",!1);ie(this,"asyncQueue");ie(this,"roomState","ready");ie(this,"createAt",Date.now());ie(this,"cwsIns");ie(this,"peerIns");ie(this,"transceiverMap",new Map);ie(this,"sendChannel");ie(this,"receiveChannel");ie(this,"userMap",new Map);ie(this,"setLocalStreamActiveMap",new Map);ie(this,"phoneyStreams",new Map);ie(this,"recorder",new StreamRecorder);ie(this,"networkQualityTester",new NetworkQualityTester);ie(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});ie(this,"reportLogs",(N,I="未知错误")=>{const{appid:D,userId:f,earlyId:k="",logUrl:i,reportErr:c}=this.options;if(!c)return;const $="web",C=M=>({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})[M].toString();{const M=C(N),J={origin:$,type:M,app_id:D,user_id:f,ins_id:k,desc:I},Z=btoa(encodeURI(JSON.stringify(J))),z=`${i}/upload/log?log_key=${Z}`;{const X=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),oe=new TextEncoder().encode(X),ne=pako.deflate(oe,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:J,url:z,size:lt(ne.byteLength)}),fetch(z,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ne})}}});ie(this,"initPhoneyStreams",(N,I=[])=>{I.length===0&&(I=mediaType_keys);for(const D of I){const f=this.phoneyStreams.get(D);if(f){const k=f.getTracks();for(const i of k)i.stop()}switch(D){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(N));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(N));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});ie(this,"getPhoneyStreams",N=>this.phoneyStreams.get(N));ie(this,"getRoomInfo",()=>{const{options:N,roomState:I,createAt:D}=this;return{...N,roomState:I,createAt:D}});ie(this,"setRoomState",N=>{this.roomState=N;const I=enum_roomState[N],D={state:N,stateStr:I};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});ie(this,"setOptions",async N=>{const I={...this.options,...N};this.options=I});ie(this,"stopStream",async N=>{const I=N.getTracks();for(const D of I)D.stop()});ie(this,"getMediaDevicesErrInfo",async()=>{try{const N=await navigator.mediaDevices.enumerateDevices();N.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),N.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(N){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",N)}return this.mediaDevicesErrInfo});ie(this,"getUserMediaKey",(N,I)=>`${N}-${I}`);ie(this,"getCallAction",async N=>{let I="";const D=k=>N.findIndex(({type:c,enabled:$=!0})=>c===k&&$)===-1?"0":"1";return I=`${D(0)}${I}`,I=`${D(1)}${I}`,I=`${D(2)}${I}`,I=`${D(3)}${I}`,parseInt(I,2)});ie(this,"getCallActionMap",(N=0)=>{const D=Number(N).toString(2).padStart(4,"0").split(""),[f,k,i,c]=D;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(f)}});ie(this,"getBanBehaviorMap",(N=0)=>{const D=Number(N).toString(2).padStart(4,"0").split(""),[f,k,i,c]=D;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(f)}});ie(this,"getAverageVolume",(N,I)=>{N.getByteFrequencyData(I);let D=0;for(let k=0;k<I.length;k++)D+=I[k];return Math.ceil(D/I.length)});ie(this,"getTrackNamesFormTracks",(N,I=[],D="trackName")=>{const f=[];for(const k of N){const{type:i}=k;if(I.length===0||I.includes(i)){const c=k[D];c&&f.push(`${c}`)}}return f});ie(this,"usersFilter",N=>dt(N,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((f,k)=>f.id.localeCompare(k.id,"en")));this.setOptions(N),this.cwsIns=new CallsWebSocket({...N}),this.asyncQueue=new p}}var m=Object.defineProperty,G=(O,N,I)=>N in O?m(O,N,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[N]=I,e=(O,N,I)=>G(O,typeof N!="symbol"?N+"":N,I);class g{constructor(N,I){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",D=>D),e(this,"stop",()=>{{const D=this.inputStream.getTracks();for(const f of D)f.stop(),this.inputStream.removeTrack(f)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(D=!0)=>{D?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",D=>{this.inputGain=D,this.inputGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async D=>{this.enhanceGain=D+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",D=>{this.bgsGain=D,this.bgsGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setBgmGain",D=>{this.bgmGain=D,this.bgmGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setOutputGain",D=>{this.outputGain=D,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:D,analyserArrayData:f}=this;D.getByteFrequencyData(f);let k=0;for(let i=0;i<f.length;i++)k+=f[i];return Math.ceil(k/f.length)}),e(this,"mixAudio",(D,f="bgm")=>new Promise(async(k,i)=>{try{{const C=this.mixAudioMap.get(f);C&&C.stop()}const c=f==="bgs"?this.bgsGainNode:this.bgmGainNode,$=this.audioContext.createBufferSource();this.mixAudioMap.set(f,$),$.buffer=D,$.connect(c),$.onended=()=>{$.disconnect(c),this.mixAudioMap.delete(f),k(!0)},$.start(0)}catch(c){i(c)}})),e(this,"mixAudioStop",D=>{const f=this.mixAudioMap.get(D);f==null||f.stop()}),e(this,"changeMix",(D,f)=>{const k=D==="bgs"?this.bgsGainNode:this.bgmGainNode;f?k.connect(this.destinationNode):k.disconnect(this.destinationNode)}),I&&(this.audioContext=I),this.inputStream=N,this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:D,inputGainNode:f,enhanceGainNode:k,bgsGainNode:i,bgmGainNode:c,analyserNode:$,outputGainNode:C,destinationNode:M}=this;D.connect(f),f.connect(k),k.connect($),i.connect($),c.connect($),k.connect(M),i.connect(M),c.connect(M),$.connect(C),C.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(I){super(I);_e(this,wt,[]);_e(this,Ke,new Map);_e(this,ze,new Map);_e(this,tt,new Map);_e(this,rt,new Map);_e(this,ut,new Map);ie(this,"localStreamsActionMap",new Map);_e(this,gt,new Map);ie(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));ie(this,"initMediaPhoneyStreams",(I=[])=>this.initPhoneyStreams(this.audioContext,I));ie(this,"initLocalStreamsFilter",()=>{for(const I of mediaType_keys){const D=async f=>f;ce(this,gt).set(I,D)}});ie(this,"setLocalFilterStream",(I,D)=>{ce(this,gt).set(I,D)});_e(this,Zt,()=>{ce(this,ze).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),ce(this,ze).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),ce(this,ze).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),ce(this,ze).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});_e(this,Jt,()=>{ce(this,Ke).set("audioinput","default"),ce(this,Ke).set("videoinput","default"),ce(this,Ke).set("audiooutput","default")});ie(this,"emitNotifyUpdateUsersStreams",async I=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:I,desc:"users streams is change."})});ie(this,"initUserMediaStreamContext",async(I,D,f)=>{const[k]=f.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:I,mediaType:D,stream:f});return}this.removeUserMediaStreamContext(I,D);const i=this.getUserMediaKey(I,D),{kind:c}=k;switch(c){case"audio":{const $=new MediaStream;$.addTrack(k);const C=new g($,this.audioContext);ce(this,tt).set(i,C)}break;case"video":{const $=new VideoMediaContext(k);ce(this,rt).set(i,$)}break}});ie(this,"getUserMediaStreamContext",(I,D)=>{const f=this.getUserMediaKey(I,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D))return ce(this,tt).get(f);if(["microphoneCamera_video","screenSharing_video"].includes(D))return ce(this,rt).get(f)});ie(this,"getUserAudioMediaStreamContext",(I,D)=>{const f=this.getUserMediaKey(I,D);return ce(this,tt).get(f)});ie(this,"removeUserMediaStreamContext",(I,D)=>{const f=this.getUserMediaKey(I,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D)){const k=ce(this,tt).get(f);return k==null||k.stop(),ce(this,tt).delete(f)}if(["microphoneCamera_video","screenSharing_video"].includes(D)){const k=ce(this,rt).get(f);return k==null||k.stop(),ce(this,rt).get(f)}});ie(this,"getUserStream",(I,D)=>{const f=this.getUserMediaStreamContext(I,D);return(f==null?void 0:f.getStream())||new MediaStream});ie(this,"getUserStreams",(I,D=[])=>{D.length===0&&(D=mediaType_keys);const f={};for(const k of D){const i=this.getUserStream(I,k);f[k]=i}return f});ie(this,"removeUserStreams",async(I,D=[])=>{D.length===0&&(D=mediaType_keys);for(const f of D)this.removeUserMediaStreamContext(I,f)});ie(this,"clearUserStreams",()=>{{const I=ce(this,tt).values();for(const D of I)D.stop();Be(this,tt,new Map)}{const I=ce(this,rt).values();for(const D of I)D.stop();Be(this,rt,new Map)}});ie(this,"setMediaTrackConstraints",async(I,D)=>{ce(this,ze).set(I,D);const f=await this.getLocalStream(I);if(!f)return;const k=f.getTracks();if(k.length!==0)for(const i of k){const c=i.getConstraints(),C={...ce(this,ze).get(I),...c,...D};await i.applyConstraints(C)}});ie(this,"stopLocalStreams",async(I=[])=>{I.length===0&&(I=mediaType_keys);for(const D of I){const f=ce(this,ut).get(D);f&&await this.stopStream(f),ce(this,ut).delete(D)}});ie(this,"addLocalStream",(I,D)=>{const f=ce(this,ut).get(I);f&&this.stopStream(f),ce(this,ut).set(I,D)});ie(this,"initLocalStream",async I=>{switch(I){case"microphoneCamera_audio":{const D=ce(this,Ke).get("audioinput"),f=ce(this,ze).get("microphoneCamera_audio"),k=await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...f},video:!1});this.addLocalStream("microphoneCamera_audio",k)}break;case"microphoneCamera_video":{const D=ce(this,Ke).get("videoinput"),f=ce(this,ze).get("microphoneCamera_video"),k=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:D,...f}});this.addLocalStream("microphoneCamera_video",k)}break;case"microphoneCamera":{const D=ce(this,Ke).get("audioinput"),f=ce(this,Ke).get("videoinput"),k=ce(this,ze).get("microphoneCamera_audio"),i=ce(this,ze).get("microphoneCamera_video"),$=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...k},video:{deviceId:f,...i}})).getTracks();for(const C of $){const{kind:M}=C;if(M==="audio"){const J=new MediaStream;J.addTrack(C),this.addLocalStream("microphoneCamera_audio",J)}if(M==="video"){const J=new MediaStream;J.addTrack(C),this.addLocalStream("microphoneCamera_video",J)}}}break;case"screenSharing_audio":{const D=ce(this,ze).get("screenSharing_audio"),k=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D})).getTracks();for(const i of k){const{kind:c}=i;if(c==="audio"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_audio",$)}}}break;case"screenSharing_video":{const D=ce(this,ze).get(I),k=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...D})).getTracks();for(const i of k){const{kind:c}=i;if(c==="video"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_video",$)}}}break;case"screenSharing":{const D=ce(this,ze).get("screenSharing_audio"),f=ce(this,ze).get("screenSharing_video"),i=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D,...f})).getTracks();for(const c of i){const{kind:$}=c;if($==="audio"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_audio",C)}if($==="video"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_video",C)}}}break}});ie(this,"getLocalStream",async I=>{const D=ce(this,ut).get(I),f=ce(this,gt).get(I);let k=D;return D&&f&&(k=await f(D)),k});ie(this,"getLocalStreams",async(I=[])=>{I.length===0&&(I=mediaType_keys);const D={};for(const f of I)D[f]=await this.getLocalStream(f);return D});_e(this,St,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=>{const D=I.filter(f=>!["communications"].includes(f.deviceId));Be(this,wt,D.sort((f,k)=>f.label.localeCompare(k.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)}),ce(this,wt)));_e(this,Vt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await ce(this,St).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),ce(this,St).call(this)});ie(this,"getMediaDeviceKind",I=>ce(this,Ke).get(I));ie(this,"changeAudiooutput",async()=>{try{const I=ce(this,Ke).get("audiooutput");await this.audioContext.setSinkId(I)}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",I)}});ie(this,"setDeviceKind",(I,D)=>{ce(this,Ke).set(I,D)});ie(this,"setAudioOutputDevice",I=>this.setDeviceKind("audiooutput",I));ie(this,"getEnumerateDevices",async I=>(await ce(this,St).call(this),ce(this,wt).filter(f=>f.kind===I)));ie(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));ie(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));ie(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));ce(this,Vt).call(this),ce(this,Jt).call(this),ce(this,Zt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var D;((D=this.audioContext)==null?void 0:D.state)==="suspended"&&this.audioContext.resume()})}}wt=new WeakMap,Ke=new WeakMap,ze=new WeakMap,tt=new WeakMap,rt=new WeakMap,ut=new WeakMap,gt=new WeakMap,Zt=new WeakMap,Jt=new WeakMap,St=new WeakMap,Vt=new WeakMap;class RoomUsers extends RoomMedias{constructor(I){super(I);ie(this,"getMaxVolumeUser",()=>{const I=Array.from(this.userMap.values(),({id:f})=>f);if(I.length===0)return;let D=[];for(const f of I){const k=this.getUserAudioMediaStreamContext(f,"microphoneCamera_audio");if(!k)continue;const i=k.getVolume();D.push({id:f,volume:i})}return D=D.sort((f,k)=>f.volume-k.volume>0?-1:1),D[0]});ie(this,"setVolume",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.setInputGain(f)});ie(this,"setEnhanceGain",async(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.setEnhanceGain(f)});ie(this,"setSpeaker",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.setOutputGain(f);const i=f===0;k==null||k.setMute(i)});ie(this,"playBgs",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);return k==null?void 0:k.mixAudio(f,"bgs")});ie(this,"setBgsGain",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.setBgsGain(f)});ie(this,"stopBgs",(I,D)=>{const f=this.getUserAudioMediaStreamContext(I,D);f==null||f.mixAudioStop("bgs")});ie(this,"playBgm",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);return k==null?void 0:k.mixAudio(f,"bgm")});ie(this,"setBgmGain",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.setBgmGain(f)});ie(this,"stopBgm",(I,D)=>{const f=this.getUserAudioMediaStreamContext(I,D);f==null||f.mixAudioStop("bgm")});ie(this,"changBgsMix",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.changeMix("bgs",f)});ie(this,"changBgmMix",(I,D,f)=>{const k=this.getUserAudioMediaStreamContext(I,D);k==null||k.changeMix("bgm",f)});ie(this,"getVolume",(I,D)=>{const f=this.getUserAudioMediaStreamContext(I,D);return f==null?void 0:f.getVolume()});ie(this,"clearUsers",()=>{this.userMap=new Map});ie(this,"removeUsers",async I=>{for(const D of I)this.userMap.delete(D),await this.removeUserStreams(D)});ie(this,"createUser",async I=>{const D=Date.now(),f={id:I,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:I===this.options.userId,isPublished:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(I,f)});ie(this,"getUser",async I=>(this.userMap.has(I)||await this.createUser(I),this.userMap.get(I)));ie(this,"getUsers",async(I=[])=>{I.length===0&&(I=[...this.userMap.keys()]);const D=[];for(const f of I){const k=await this.getUser(f);D.push(k)}return D});ie(this,"getAllUserTrackMids",async()=>{const I=await this.getUsers(),D=[];for(const f of I){const{tracks:k=[]}=f;for(const i of k)D.push(i.mid)}return D});ie(this,"getUserTrackByTrackName",async I=>{const D=await this.getUsers(),f=[];for(const k of D){const{tracks:i=[]}=k;for(const c of i){const{trackName:$}=c;I.includes($)&&f.push(c)}}return f});ie(this,"getUserTrackFromMid",async I=>{const D=await this.getUsers();let f;for(const k of D){const{tracks:i=[]}=k;for(const c of i)if(c.mid===I){f=c;break}}return f});ie(this,"checkUserInRoom",I=>this.userMap.has(I));ie(this,"getUsersId",async()=>[...this.userMap.keys()]);ie(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));ie(this,"updateIsPublished",async(I,D=!1)=>{const f=await this.getUser(I);f.isPublished=D});ie(this,"setUserUpdateStreams",async(I,D,f=!0)=>{const k=await this.getUser(I),i={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};i[D]=f,k.updateStreams=i});ie(this,"updateUserChannels",async(I,D=[],f)=>{const k=await this.getUser(I);f&&(D=[...k.channels,...D]),k.channels=D});ie(this,"updateUsertracks",async(I,D=[],f)=>{const k=await this.getUser(I);f&&(D=[...k.tracks,...D]),D=D.filter(({mid:$=""})=>$!==""),D=pt(D,["type"]),D=D.sort(($,C)=>$.type-C.type<0?-1:1);for(const $ of D)$.userId=I,$.mediaType=mediaType_keys[$.type],$.enabled===void 0&&($.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const i=dt(k.tracks,["mediaType","enabled","mid","msid","trackName"]),c=dt(D,["mediaType","enabled","mid","msid","trackName"]);{const $="microphoneCamera_audio",C=c.find(Z=>Z.mediaType===$),M=i.find(Z=>Z.mediaType===$),J=JSON.stringify(C)!==JSON.stringify(M);k.updateStreams[$]=J}{const $="microphoneCamera_video",C=c.find(Z=>Z.mediaType===$),M=i.find(Z=>Z.mediaType===$),J=JSON.stringify(C)!==JSON.stringify(M);k.updateStreams[$]=J}{const $="screenSharing_audio",C=c.find(Z=>Z.mediaType===$),M=i.find(Z=>Z.mediaType===$),J=JSON.stringify(C)!==JSON.stringify(M);k.updateStreams[$]=J}{const $="screenSharing_video",C=c.find(Z=>Z.mediaType===$),M=i.find(Z=>Z.mediaType===$),J=JSON.stringify(C)!==JSON.stringify(M);k.updateStreams[$]=J}k.tracks=D});ie(this,"updateUserCallAction",async(I,D=0)=>{const f=await this.getUser(I);f.callAction=D,f.callActionStr=D.toString(2).padStart(4,"0"),f.callActionMap=this.getCallActionMap(D)});ie(this,"updateUserBehaviors",async(I,D=0)=>{const f=await this.getUser(I);f.banBehavior=D,f.banBehaviorStr=D.toString(2).padStart(4,"0"),f.banBehaviorMap=this.getBanBehaviorMap(D)});ie(this,"updateUserNetwork",async(I,D={egress:5,ingress:5})=>{const f=await this.getUser(I);f.network=D});ie(this,"updateUserPermissions",async(I,D)=>{if(D){const f=await this.getUser(I);f.permissions=D}});ie(this,"updateUserBase",async I=>{const D=await this.getUser(I);D.isSelf=I===this.options.userId,D.updateAt=Date.now()});ie(this,"updateUsers",async I=>{for(const D of I){const{id:f,tracks:k,callAction:i,permissions:c,isPublished:$}=D;await this.updateUserBase(f),await this.updateIsPublished(f,$),await this.updateUserPermissions(f,c),await this.updateUsertracks(f,k,!0),await this.updateUserCallAction(f,i),await this.updateUserNetwork(f)}});ie(this,"emitNotifyUpdateUser",async I=>{const D=await this.getUsers([I]),[f]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:f,desc:"user info is change."})});ie(this,"emitNotifyUpdateUsers",async()=>{const I=await this.getUsers(),D=this.usersFilter(I);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(I){super(I);ie(this,"getPeerStatsTimer",0);ie(this,"reports",[]);ie(this,"candidates",[]);_e(this,Nt,[]);_e(this,Tt,0);ie(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});ie(this,"initPeer",()=>{var I;clearTimeout(ce(this,Tt)),this.transceiverMap=new Map,(I=this.peerIns)==null||I.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),ce(this,Gt).call(this),ce(this,Kt).call(this)});ie(this,"initSendChannel",(I="",D)=>{const f=this.peerIns.createDataChannel(I,{negotiated:!0,id:D});f.addEventListener("open",async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onopen",k),setInterval(()=>{const i=new Date().getTime();f.send(`Hi you! on: ${E(i)}`)},1e3)}),f.addEventListener("close",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: close",k)}),f.addEventListener("message",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onmessage",k)}),this.sendChannel=f,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initSendChannel",{label:I,id:D,channel:f})});ie(this,"initReceiveChannel",(I="",D)=>{const f=this.peerIns.createDataChannel(I,{negotiated:!0,id:D});f.addEventListener("open",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onopen",k)}),f.addEventListener("close",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: close",k)}),f.addEventListener("message",async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onmessage",k)}),this.receiveChannel=f,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initReceiveChannel",{label:I,id:D,channel:f}),this.receiveChannel.send("hello")});ie(this,"replaceSenderStream",async(I=[],D)=>{const{userId:f}=this.options;I.length===0&&(I=mediaType_keys);for(const k of I){const i=this.transceiverMap.get(k);let c;if(i){const{sender:$}=i;D?c=this.getUserStream(f,k):c=this.getPhoneyStreams(k);const[C]=c.getTracks();C&&await $.replaceTrack(C)}}});ie(this,"getSenderTracks",async(I=[])=>{const D=[];for(const f of I){const k=this.transceiverMap.get(f);if(!k)continue;const{mid:i,sender:c}=k,{track:$}=c;if(!$)continue;const{id:C,enabled:M}=$,J=mediaType_keys.findIndex(z=>z===f),Z={type:J,enabled:M,trackName:`web-${J}-${C}`,location:"local",mid:i};D.push(Z)}return D});ie(this,"addSenders",async(I=[])=>{I.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const D=[];for(const f of I){if(this.transceiverMap.get(f))continue;const i=this.getPhoneyStreams(f),[c]=i.getTracks(),$=this.peerIns.addTransceiver(c,{direction:"sendonly"});this.transceiverMap.set(f,$),D.push(f)}if(I.length===0||D.length!==0){const f=await this.peerIns.createOffer();if(this.options.debug){const k=libExports$1.parse(f.sdp),i=dt(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:k,description:f})}await this.peerIns.setLocalDescription(f)}return D});ie(this,"removeSenders",async(I=[])=>{I.length===0&&(I=mediaType_keys);for(const D of I)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});ie(this,"onSubscribeUserTracks",I=>{let D=0;return new Promise(async f=>{const k=[];for(const i of I){const{tracks:c=[]}=i;for(const $ of c){const{trackName:C,mid:M}=$,[J]=await this.getUserTrackByTrackName([C]);k.push({...J,mid:M})}}{let i=[];const c=async()=>{clearTimeout(D);const C=new Map;for(const J of i){const{userId:Z,mediaType:z}=J;if(!Z||!z)continue;C.has(Z)||C.set(Z,{userId:Z,tracks:[],updateStreams:{}});const re=C.get(Z);re.tracks.push(J),re.updateStreams[z]=!0}const M=[...C.values()];for(const J of M){const{userId:Z,tracks:z}=J;await this.updateUsertracks(Z,z,!0)}await this.emitNotifyUpdateUsersStreams(M),this.peerIns.removeEventListener("track",$);{const J=Array.from(k,X=>X.trackName),Z=Array.from(i,X=>X.trackName),z=J.filter(X=>!Z.includes(X));f({target:J,success:Z,fail:z})}},$=async C=>{const{streams:M,transceiver:J}=C,[Z]=M,{mid:z,receiver:X}=J,{track:re}=X,{id:oe}=re,ne=k.find(Q=>Q.mid===`${z}`);if(!ne)return;const{userId:de,mediaType:ye}=ne;if(!(!de||!ye)){{const Q={...ne,mid:z,msid:oe};i.push(Q)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${i.length}/${k.length}`,{mediaType:ye,mid:z,userTrack:ne,e:C});{const Q=new Audio;if(Q.srcObject=Z,await this.initUserMediaStreamContext(de,ye,Z),ye==="microphoneCamera_audio"||ye==="screenSharing_audio"){const ae=this.getUserAudioMediaStreamContext(de,ye);ae==null||ae.setMute(!1)}}k.length===i.length&&c()}};this.peerIns.addEventListener("track",$),D=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${i.length}/${k.length})`),c()},5*1e3)}})});_e(this,Gt,()=>{const I=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=async()=>{const D=this.peerIns.iceConnectionState;switch(clearTimeout(ce(this,Tt)),D){case"connected":{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${D}`),this.setRoomState("connected");for(const f of ce(this,Nt))await f()}break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${D}`),Be(this,Tt,window.setTimeout(I,30*1e3));break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${D}`),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:${D}`),I();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${D}`);break}}});ie(this,"iceConnected",()=>new Promise(I=>{if(this.peerIns.iceConnectionState==="connected")return I(!0);ce(this,Nt).push(I)}));ie(this,"closeUserTracks",async(I,D=[],f=!1)=>{const k=[];for(const C of D){const{trackName:M,msid:J}=C;k.push(M),J&&k.push(J)}const i=C=>k.includes(C),c=this.peerIns.getTransceivers();for(const C of c){const{mid:M,sender:J,receiver:Z}=C;J.track&&i(J.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${M} is stop.`,C)),Z.track&&i(Z.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${M} is stop.`,C))}const $=await this.getUser(I);if($){for(const C of $.tracks){const{trackName:M,msid:J,userId:Z,mediaType:z}=C;!Z||!z||!i(M)||(this.removeUserMediaStreamContext(Z,z),J&&delete C.msid)}if(f){const C=$.tracks.filter(({trackName:M})=>!i(M));await this.updateUsertracks(I,C,!1)}}});ie(this,"createOffer",async()=>{const I=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse(I.sdp),f=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:f,sdpJson:D,description:I})}await this.peerIns.setLocalDescription(I)});ie(this,"createAnswer",async()=>{const I=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports$1.parse(I.sdp),f=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:f,sdpJson:D,description:I})}await this.peerIns.setLocalDescription(I)});ie(this,"getSdp",()=>{var I;return(I=this.peerIns.localDescription)==null?void 0:I.sdp});ie(this,"setRemoteDescription",async I=>{if(this.options.debug){const D=libExports$1.parse(I.sdp),f=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:f,sdpJson:D,description:I})}return await this.peerIns.setRemoteDescription(I),I});ie(this,"setCallStrategy",async(I,D=[])=>{D.length===0&&(D=mediaType_keys);let f="balanced";switch(I){case"qualityPriority":f="maintain-resolution";break;case"fluencyPriority":f="maintain-framerate";break;case"balancedDowngrade":f="balanced";break}const k=await this.getSelfInfo(),i=Array.from(k.tracks,({trackName:$})=>$),c=this.peerIns.getSenders();for(const $ of c){const{track:C}=$;if(!C||!i.includes(C.id))continue;const M=$.getParameters();$.setParameters({...M,degradationPreference:f})}});ie(this,"setRTCRtpSenderParameters",I=>{try{const D=this.peerIns.getSenders();for(const f of D){const k=f.getParameters();f.setParameters({...k,...I})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});ie(this,"getReportsByMid",async(I=[])=>I.length===0?this.reports:this.reports.filter(D=>I.includes(D.mid)));ie(this,"getRoomNetwork",()=>this.peerNetwork);ie(this,"getPeerNetwork",()=>this.peerNetwork);_e(this,Wt,async()=>{try{const I=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],k=[...I.values()].filter(ae=>D.includes(ae.type));let i=0,c=0,$=0,C=0,M=0,J=0,Z=[],z=[];for(const ae of this.reports){const{packetsSent:he,packetsLost:se}=ae;he&&($+=he),se&&(C+=se)}this.reports=k;for(const ae of this.reports){const{bytesSent:he,bytesReceived:se,packetsSent:fe,packetsLost:me,roundTripTime:ee,jitter:le}=ae;he&&(c=he),se&&(i=se),fe&&(M+=fe),me&&(J+=me),ee&&Z.push((ee*100).toFixed(2)),le&&z.push(le.toFixed(2))}z.sort().reverse(),Z.sort().reverse();const X=M-$,re=J-C,oe=X===0?"0.00":(re/X).toFixed(2),[ne="0"]=Z,[de="0"]=z,ye={outboundBytes:c,inboundBytes:i,lostRate:oe,roundTripTime:ne,jitter:de};this.peerNetwork=ye;const Q=(ae,he,se)=>{const fe=Number(ae),me=Number(he),ee=Number(se);let le="0";return fe<.03&&me<100&&ee<.05?le="5":fe<.06&&me<160&&ee<.1?le="4":fe<.1&&me<250&&ee<.15?le="3":fe<.15&&me<400&&ee<.2?le="2":le="1",Number(le)};{const ae=Q(oe,ne,de),he=await this.getSelfInfo(),{network:se}=he,fe={egress:ae,ingress:ae};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,fe),JSON.stringify(se)!==JSON.stringify(fe)){this.emitNotifyUpdateUsers();const{userId:le,roomId:ve}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...fe,userId:le,roomId:ve}},!1)}},3*1e3)}}catch(I){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",I)}});_e(this,Kt,()=>{const I=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||ce(this,Wt).call(this)};this.getPeerStatsTimer=window.setInterval(I,1*1e3)});ie(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Nt=new WeakMap,Tt=new WeakMap,Gt=new WeakMap,Wt=new WeakMap,Kt=new WeakMap;class RoomCalls extends RoomPeer{constructor(I){super(I);_e(this,Ot,0);_e(this,qt,[]);ie(this,"setLocalStream",(I,D)=>new Promise(async(f,k)=>{try{typeof I=="string"&&(I=[I]);for(const c of I)this.localStreamsActionMap.set(c,D);if(D){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 c=await this.getLocalStream("screenSharing_audio");if(c){const $=c.getTracks();for(const C of $)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(I.includes("screenSharing_video")){const c=await this.getLocalStream("screenSharing_video");if(c){const $=c.getTracks();for(const C of $)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(I);const i=await this.getLocalStreams(I);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),f(i)}catch(i){k(i)}}));ie(this,"setMediaDeviceKind",(I,D)=>new Promise(async(f,k)=>{this.setDeviceKind(I,D);const i=await this.getSelfInfo(),{id:c,tracks:$=[],callActionMap:C}=i,M=[],J=async Z=>{const z=this.localStreamsActionMap.get(Z),X=$.find(oe=>oe.mediaType===Z),re=C[Z];if(z){M.push(Z),await this.stopLocalStreams([Z]);try{await this.initLocalStream(Z)}catch(oe){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",oe),await this.inactiveTracks([Z],!1),k(oe)}}if(X){const oe=await this.getLocalStream(Z);oe&&(await this.initUserMediaStreamContext(c,Z,oe),re&&await this.replaceSenderStream([Z],!0))}{const oe=await this.getLocalStreams(M);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:oe,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),f(!0)}};I==="audioinput"&&await J("microphoneCamera_audio"),I==="videoinput"&&await J("microphoneCamera_video"),I==="audiooutput"&&(await this.changeAudiooutput(),f(!0))}));ie(this,"changeScreenSharing",async I=>{const D=await this.getSelfInfo(),{tracks:f=[],callActionMap:k}=D;try{await this.setLocalStream(I,!0);for(const i of I)f.find($=>$.mediaType===i&&k[i])&&await this.replaceSenderStream([i],!0)}catch(i){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",i)}});ie(this,"createSession",()=>new Promise(async(I,D)=>{try{await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async f=>{const{code:k=0,desc:i,data:c}=f;if(k!==200)throw new Error(i);const{remoteSdp:$}=c;if(this.options.debug){const C=libExports$1.parse($),M=dt(C.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:M,sdpJson:C})}await this.setRemoteDescription({type:"answer",sdp:$}),await this.iceConnected().then(()=>{I(!0)})})}catch(f){D(f)}}));ie(this,"earlyConnect",(I=[])=>(this.isEarly=!0,ce(this,Ut).call(this).then(async()=>{await this.createSession(),I.length===0&&(I=["microphoneCamera_audio","microphoneCamera_video"]),await ce(this,Mt).call(this,I)})));ie(this,"joinRoom",async I=>new Promise(async(D,f)=>{try{this.setOptions(I),this.isEarly===!1&&await ce(this,Ut).call(this),await ce(this,Xt).call(this),this.clearUsers();const{roomId:k,userId:i,callType:c,sdkToken:$}=this.options;await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:c,roomId:k,user:{id:i,tracks:[],callAction:0},token:$},version:2}).then(async C=>{const{code:M=0,desc:J="服务器繁忙",data:Z}=C;if(M!==200)throw new Error(J);const{roomId:z="",roomUsers:X=[]}=Z;if(z!==k)return f("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.isEarly===!1&&await this.createSession(),await this.updateUsers(X);const re=[];for(const ne of X){const{id:de,channelCache:ye}=ne,{channels:Q=[]}=ye;await this.updateUserBehaviors(de,ne.behavior),await this.updateUserChannels(de,Q,!1),Q.length!==0&&re.push({userId:de,channels:Q})}await this.subChannel(re),await this.emitNotifyUpdateUsers();const oe=await this.getUsers();D(oe)})}catch(k){f(k)}}));ie(this,"quitRoom",()=>new Promise(async I=>{const{roomId:D,userId:f}=this.options,k={roomId:D,user:{id:f}};try{this.isInRoom=!1,this.asyncQueue.clear(),clearInterval(ce(this,Ot)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),await this.cwsIns.sendMessage({event:"quitRoom",data:k}),I(!0)}));ie(this,"quitRoomEx",()=>new Promise(async I=>{const{roomId:D,userId:f}=this.options,k={roomId:D,user:{id:f}};try{this.isInRoom=!1,this.asyncQueue.clear(),this.stopHeartbeat(),this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:k}),I(!0)}));ie(this,"syncRoomInfo",()=>new Promise(async(I,D)=>{const{userId:f}=this.options,k=await this.getUser(f),{id:i=f,callAction:c=0}=k;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:c}}}).then(async $=>{const{code:C=0,desc:M}=$;if(C!==200)throw new Error(M);const J=$.data.users;this.clearUsers(),await this.updateUsers(J),await this.updateUsertracks(k.id,k.tracks,!1);{const Z=await this.getUsers();I(Z)}}).catch($=>D($))}));ie(this,"checkInRoom",()=>new Promise(async I=>{const{userId:D}=this.options,f=await this.getUser(D),{id:k=D,callAction:i=0}=f;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:k,callAction:i}}}).then(async c=>{var Z;const{code:$=0,desc:C}=c;if($!==200)throw new Error(C);const M=c.data.users;return(Z=c.data)!=null&&Z.isActive||M.find(z=>z.id===this.options.userId)?I(!0):I(!1)}).catch(()=>I(!1))}));ie(this,"publish",I=>{const D=()=>new Promise(async(f,k)=>{try{{const Z=await this.getSelfInfo(),{banBehaviorMap:z}=Z;let X=!0;for(const re of I)if(z[re]){X=!1;break}if(X===!1)return k("publish is error: prohibited by administrator.")}try{await this.setLocalStream(I,!0)}catch(Z){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",Z)}const i=await this.getSelfInfo(),c=[];for(const Z of I){{const z=this.getPhoneyStreams(Z);await this.initUserMediaStreamContext(i.id,Z,z)}{const z=await this.getLocalStream(Z);z?await this.initUserMediaStreamContext(i.id,Z,z):c.push(Z)}}const $=I.filter(Z=>!c.includes(Z)||["microphoneCamera_audio","microphoneCamera_video"].includes(Z));await this.replaceSenderStream(I,!1),await ce(this,Mt).call(this,$);const C=await this.getSenderTracks($),M=[...i.tracks,...C];await this.updateUsertracks(i.id,M,!0),c.length!==0&&await this.inactiveTracks(c,!1),$.length!==0&&await this.replaceSenderStream($,!0);const J=await this.getCallAction(M);await ce(this,It).call(this,J),await new Promise(Z=>setTimeout(()=>Z(!0),230)),ce(this,Yt).call(this,I);{await this.emitNotifyUpdateUsers();const Z=await this.getSelfInfo();f(Z)}}catch(i){this.reportLogs("publish_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"publish"})});ie(this,"stopPublish",(I=[])=>{const D=()=>new Promise(async(f,k)=>{try{const i=await this.getSelfInfo();I.length===0&&(I=mediaType_keys);const c=i.tracks.filter(({mediaType:C})=>C&&I.includes(C)),$=async()=>{this.initMediaPhoneyStreams(I);const C=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),f(C)};if(c.length===0)return $();await this.replaceSenderStream(I,!0),await this.closeUserTracks(i.id,c,!0),await this.removeSenders(I);{const C=await this.getCallAction(i.tracks);await ce(this,It).call(this,C)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:M=0,data:J,desc:Z}=C;if(M!==200)throw new Error(Z);const{remoteSdp:z}=J;await this.setRemoteDescription({type:"answer",sdp:z}),$()})}catch(i){this.reportLogs("close_track_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"stopPublish"})});ie(this,"subscribe",(I=[],D=3)=>{const f=()=>new Promise(async(k,i)=>{try{await this.iceConnected();const c=await this.getUsers();let $=[];for(const Z of c){const{isSelf:z,tracks:X=[]}=Z;if(!z){const re=X.filter(({trackName:oe,mid:ne=""})=>ne!==""&&(I.includes(oe)||I.length===0));re.length!==0&&$.push({...Z,tracks:re})}}const C=async(Z={})=>{const z=Array.from($,({id:re})=>re),X=await this.getUsers(z);await this.emitNotifyUpdateUsers(),k({users:X,detail:Z})};if($.length===0)return C();const M=[];for(const Z of $){const{id:z,tracks:X}=Z,re=dt(X,["type","trackName"]),oe={id:z,tracks:re};M.push(oe)}const J=async()=>{await this.cwsIns.sendMessage({event:"subscribe",data:{users:M}}).then(async Z=>{const{code:z=0,data:X,desc:re}=Z;if(z===2017&&re.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),z!==200){if(D>=0)return D--,await J();throw new Error(re)}const{remoteSdp:oe,users:ne=[]}=X;this.onSubscribeUserTracks(ne).then(async de=>{await this.renegotiate().then(()=>C(de))}).catch(de=>{throw new Error(de)}),await this.setRemoteDescription({type:"offer",sdp:oe})})};await J()}catch(c){this.reportLogs("subscribe_error",c.message||c),i(c)}});return this.asyncQueue.add(f,{describe:"subscribe"})});ie(this,"renegotiate",()=>new Promise(async(I,D)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(f=>{const{code:k=0,desc:i}=f;if(k!==200)throw new Error(i);I(f)})}catch(f){D(f)}}));ie(this,"stopSubscribe",(I=[])=>{const D=()=>new Promise(async(f,k)=>{try{const i=await this.getUsers(),c=[];for(const C of i){const{tracks:M=[]}=C;for(const J of M){const{type:Z,mid:z,trackName:X,mediaType:re,msid:oe}=J;if(!(!re||!oe)&&(I.length===0||I.includes(X))){const ne={type:Z,mid:z,trackName:oe};c.push(ne),await this.closeUserTracks(C.id,[J])}}}const $=async()=>{await this.emitNotifyUpdateUsers(),f(!0)};if(c.length===0)return $();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{remoteSdp:M}=C.data;await this.setRemoteDescription({type:"answer",sdp:M})}),$()}catch(i){this.reportLogs("close_track_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"stopSubscribe"})});ie(this,"inactiveTracks",async(I,D)=>new Promise(async f=>{const k=await this.getSelfInfo();if(!k||!k.id)return f(!0);const{tracks:i=[]}=k,c=[...i];for(let C of c){const{mediaType:M}=C;if(M&&I.includes(M)){C.enabled=D;const J=await this.getLocalStream(M);if(!J)continue;const Z=J.getTracks();for(const z of Z)z.enabled=D}}await this.replaceSenderStream(I,D);const $=await this.getCallAction(c);await ce(this,It).call(this,$),await this.emitNotifyUpdateUsers(),f(!0)}));ie(this,"setBanBehaviors",I=>new Promise(async(D,f)=>{try{const{roomId:k}=this.options,i=[];for(const c of I){const{id:$,banBehaviors:C}=c,M=Object.keys(C);if(M.length===0)continue;const J=[];for(const z of M){const X=mediaType_keys.findIndex(ne=>ne===z),re=C[z],oe={type:X,behavior:re};J.push(oe)}const Z={id:$,behaviors:J};i.push(Z)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:k,users:i}}).then(async c=>{const{code:$=0,desc:C}=c;if($!==200)return f(C);D(c)})}catch(k){f(k)}}));ie(this,"pubChannel",()=>new Promise(async(I,D)=>{const k=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:k}}).then(async i=>{const{code:c=0,data:$,desc:C}=i;if(c!==200)throw new Error(C);const{channels:M=[]}=$;for(const J of M){const{channels:Z=[]}=J;for(const z of Z){const{dataChannelName:X,id:re}=z;this.initSendChannel(X,re)}}I(!0)}).catch(i=>{D(i)})}));ie(this,"subChannel",(I=[])=>new Promise(async D=>{if(I.length===0)return D(!0);await this.cwsIns.sendMessage({event:"subChannel",data:{channels:I}}).then(async f=>{const{code:k=0,data:i,desc:c}=f;if(k!==200)throw new Error(c);const{channels:$=[]}=i;for(const C of $){const{channels:M=[]}=C;for(const J of M){const{dataChannelName:Z,id:z}=J;this.initReceiveChannel(Z,z)}}})}));ie(this,"debugger",()=>new Promise(async(I,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async f=>{if(f.code!==200)return D(f.desc);I(!0)}).catch(f=>{D(f)})}));ie(this,"shutdown",()=>new Promise(async(I,D)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async f=>{if(f.code!==200)return D(f.desc);I(!0)}).catch(f=>{D(f)})}));ie(this,"initHeartbeat",()=>{this.stopHeartbeat();const I=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),D=this.isInRoom?5*1e3:30*1e3;Be(this,Ot,window.setInterval(I,D)),I()});ie(this,"stopHeartbeat",()=>{clearInterval(ce(this,Ot))});_e(this,Yt,async I=>new Promise(async(D,f)=>{try{const{roomId:k}=this.options;if(!k)return;const{id:i,tracks:c=[]}=await this.getSelfInfo(),$=c.filter(C=>C.mediaType&&I.includes(C.mediaType));if($.length===0)return;await this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:k,user:{id:i,tracks:$}}}),D(!0)}catch(k){f(k)}}));_e(this,It,async I=>new Promise(async(D,f)=>{const{roomId:k,userId:i}=this.options,c={roomId:k,user:{id:i,callAction:I}};await this.cwsIns.sendMessage({event:"updateCall",data:c}).then(async $=>{const{code:C=0}=$;if(C!==200)return f($);await this.updateUserCallAction(i,I),D(I)}).catch($=>f($))}));_e(this,Ut,()=>new Promise(async(I,D)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return I(!0);this.cwsIns.clearEvents(),this.initPeer();const{appid:f,roomId:k,userId:i}=this.options;if(!f)return D("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const c={c:f,r:k,v:this.sdk_service_version};if(this.isEarly){const C=xt();c.i=C,this.setOptions({earlyId:C})}else c.b=i;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",c);const $=btoa(encodeURI(JSON.stringify(c)));await this.cwsIns.connect($),this.initHeartbeat();for(const C of ce(this,qt))await C();I(!0)}catch(f){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",f),this.reportLogs("ws_c_timeout",f.message||f),D(f)}}));_e(this,Mt,async I=>new Promise(async(D,f)=>{try{await this.iceConnected();const k=await this.addSenders(I),i=await this.getSenderTracks(k);if(i.length===0)return D(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:i,callAction:0}}).then(async c=>{const{code:$=0,desc:C,data:M}=c;if($!==200)throw new Error(C);const{remoteSdp:J}=M;await this.setRemoteDescription({type:"answer",sdp:J}),D(!0)})}catch(k){this.reportLogs("publish_error",k.message||k),await this.removeSenders(I),f(k)}}));_e(this,Xt,()=>new Promise(I=>{if(this.cwsIns.state==="connected")return I(!0);ce(this,qt).push(I)}))}}Ot=new WeakMap,qt=new WeakMap,Yt=new WeakMap,It=new WeakMap,Ut=new WeakMap,Mt=new WeakMap,Xt=new WeakMap;class Room extends RoomCalls{constructor(N){super(N)}}class QuickVO extends Room{constructor(I){super(I);_e(this,kt,new Map);ie(this,"reconstruct",async()=>{if(this.cwsIns.state!=="connected")return;this.setRoomState("ready"),this.initMediaPhoneyStreams(),this.asyncQueue.clear(),this.initPeer(),await this.createSession();const I=[],D=[],f=await this.getUsers();for(const k of f){const{isSelf:i,callActionMap:c,tracks:$=[]}=k;if(i)for(const C of mediaType_keys)c[C]&&I.push(C);for(const C of $)C.msid&&D.push(C.trackName)}await this.syncRoomInfo(),await this.publish(I),await this.subscribe(D)});_e(this,Qt,()=>{{const I=async D=>{const{state:f}=D.data;if(f==="closed"){const{roomId:k,userId:i}=this.options,c={roomId:k,user:{id:i}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:c}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:I},!0)}{const I=async D=>{const{qualities:f=[]}=D.data,[k]=f;if(!(k&&k.userId===this.options.userId&&f.length===1)){for(const i of f){const{userId:c,egress:$,ingress:C}=i;this.checkUserInRoom(c)&&await this.updateUserNetwork(c,{egress:$,ingress:C})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:I},!0)}{const I=async D=>{const f=D.data.user;await this.updateUsers([f]),await this.updateUsertracks(f.id,f.track,!1),await this.updateUserBehaviors(f.id,f.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:I},!0)}{const I=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:I},!0)}{const I=async D=>{const{user:f}=D.data,{id:k,tracks:i=[],callAction:c=0}=f;if(await this.updateUserCallAction(k,c),await this.updateUserPermissions(k,3),await this.updateUsertracks(k,i,!0),this.options.newPublishAutoSubscribe){const $=this.getTrackNamesFormTracks(i);await this.subscribe($)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:I},!0)}{const I=async D=>{const f=[D.data];this.subChannel(f)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:I},!0)}{const I=async D=>{const{id:f,tracks:k}=D.data.user;f!==this.options.userId&&(await this.closeUserTracks(f,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:I},!0)}{const I=async D=>{const{id:f,callAction:k}=D.data.user;this.checkUserInRoom(f)&&(await this.updateUserCallAction(f,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:I},!0)}{const I=async D=>{const{user:f}=D.data,{id:k,permissions:i=1}=f;i===1?await this.removeUsers([k]):i===3&&await this.updateUsers([f]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:I},!0)}{const I=async D=>{const{users:f}=D.data;for(const k of f){const{id:i,behavior:c}=k;await this.updateUserBehaviors(i,c)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:I},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async I=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ie(this,"addNotify",I=>this.cwsIns.addNotify(I));_e(this,en,()=>{});_e(this,tn,()=>{this.cwsIns.onReconnectSuccess=async()=>{if(this.isInRoom&&await this.checkInRoom())return await this.reconstruct()}});_e(this,nn,async()=>{this.cwsIns.onReconnectStop=async()=>{this.setRoomState("closed")}});ie(this,"addRequestAnimationFrame",async(I,D)=>{{const k=ce(this,kt).get(I);k&&cancelAnimationFrame(k)}const f=(k=Date.now())=>{D(k);const i=requestAnimationFrame(f);ce(this,kt).set(I,i)};f()});ie(this,"clearRequestAnimationFrame",async(I=[])=>{I.length===0&&(I=[...ce(this,kt).keys()]);const D=[];for(const f of I){const k=ce(this,kt).get(f);k&&(cancelAnimationFrame(k),D.push(k))}return D});ie(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(I=>setTimeout(()=>I(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.clearEvents(),this.cwsIns.close()});ce(this,en).call(this),ce(this,tn).call(this),ce(this,nn).call(this),ce(this,Qt).call(this)}}kt=new WeakMap,Qt=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
9
+ */var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(O){const N=requireBase64Js(),$=requireIeee754(),D=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;O.Buffer=c,O.SlowBuffer=de,O.INSPECT_MAX_BYTES=50;const b=2147483647;O.kMaxLength=b,c.TYPED_ARRAY_SUPPORT=k(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function k(){try{const K=new Uint8Array(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,Uint8Array.prototype),Object.setPrototypeOf(K,F),K.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function i(K){if(K>b)throw new RangeError('The value "'+K+'" is invalid for option "size"');const F=new Uint8Array(K);return Object.setPrototypeOf(F,c.prototype),F}function c(K,F,j){if(typeof K=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(K)}return S(K,F,j)}c.poolSize=8192;function S(K,F,j){if(typeof K=="string")return J(K,F);if(ArrayBuffer.isView(K))return Y(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(et(K,ArrayBuffer)||K&&et(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(K,SharedArrayBuffer)||K&&et(K.buffer,SharedArrayBuffer)))return re(K,F,j);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=K.valueOf&&K.valueOf();if(X!=null&&X!==K)return c.from(X,F,j);const te=oe(K);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return c.from(K[Symbol.toPrimitive]("string"),F,j);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}c.from=function(K,F,j){return S(K,F,j)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function C(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function M(K,F,j){return C(K),K<=0?i(K):F!==void 0?typeof j=="string"?i(K).fill(F,j):i(K).fill(F):i(K)}c.alloc=function(K,F,j){return M(K,F,j)};function Z(K){return C(K),i(K<0?0:ie(K)|0)}c.allocUnsafe=function(K){return Z(K)},c.allocUnsafeSlow=function(K){return Z(K)};function J(K,F){if((typeof F!="string"||F==="")&&(F="utf8"),!c.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const j=ye(K,F)|0;let X=i(j);const te=X.write(K,F);return te!==j&&(X=X.slice(0,te)),X}function z(K){const F=K.length<0?0:ie(K.length)|0,j=i(F);for(let X=0;X<F;X+=1)j[X]=K[X]&255;return j}function Y(K){if(et(K,Uint8Array)){const F=new Uint8Array(K);return re(F.buffer,F.byteOffset,F.byteLength)}return z(K)}function re(K,F,j){if(F<0||K.byteLength<F)throw new RangeError('"offset" is outside of buffer bounds');if(K.byteLength<F+(j||0))throw new RangeError('"length" is outside of buffer bounds');let X;return F===void 0&&j===void 0?X=new Uint8Array(K):j===void 0?X=new Uint8Array(K,F):X=new Uint8Array(K,F,j),Object.setPrototypeOf(X,c.prototype),X}function oe(K){if(c.isBuffer(K)){const F=ie(K.length)|0,j=i(F);return j.length===0||K.copy(j,0,0,F),j}if(K.length!==void 0)return typeof K.length!="number"||Qt(K.length)?i(0):z(K);if(K.type==="Buffer"&&Array.isArray(K.data))return z(K.data)}function ie(K){if(K>=b)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+b.toString(16)+" bytes");return K|0}function de(K){return+K!=K&&(K=0),c.alloc(+K)}c.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==c.prototype},c.compare=function(F,j){if(et(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),et(j,Uint8Array)&&(j=c.from(j,j.offset,j.byteLength)),!c.isBuffer(F)||!c.isBuffer(j))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===j)return 0;let X=F.length,te=j.length;for(let ue=0,pe=Math.min(X,te);ue<pe;++ue)if(F[ue]!==j[ue]){X=F[ue],te=j[ue];break}return X<te?-1:te<X?1:0},c.isEncoding=function(F){switch(String(F).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(F,j){if(!Array.isArray(F))throw new TypeError('"list" argument must be an Array of Buffers');if(F.length===0)return c.alloc(0);let X;if(j===void 0)for(j=0,X=0;X<F.length;++X)j+=F[X].length;const te=c.allocUnsafe(j);let ue=0;for(X=0;X<F.length;++X){let pe=F[X];if(et(pe,Uint8Array))ue+pe.length>te.length?(c.isBuffer(pe)||(pe=c.from(pe)),pe.copy(te,ue)):Uint8Array.prototype.set.call(te,pe,ue);else if(c.isBuffer(pe))pe.copy(te,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=pe.length}return te};function ye(K,F){if(c.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||et(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);const j=K.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&j===0)return 0;let te=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return j;case"utf8":case"utf-8":return ot(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j*2;case"hex":return j>>>1;case"base64":return At(K).length;default:if(te)return X?-1:ot(K).length;F=(""+F).toLowerCase(),te=!0}}c.byteLength=ye;function Q(K,F,j){let X=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((j===void 0||j>this.length)&&(j=this.length),j<=0)||(j>>>=0,F>>>=0,j<=F))return"";for(K||(K="utf8");;)switch(K){case"hex":return We(this,F,j);case"utf8":case"utf-8":return we(this,F,j);case"ascii":return Le(this,F,j);case"latin1":case"binary":return Fe(this,F,j);case"base64":return be(this,F,j);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ft(this,F,j);default:if(X)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),X=!0}}c.prototype._isBuffer=!0;function ae(K,F,j){const X=K[F];K[F]=K[j],K[j]=X}c.prototype.swap16=function(){const F=this.length;if(F%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let j=0;j<F;j+=2)ae(this,j,j+1);return this},c.prototype.swap32=function(){const F=this.length;if(F%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let j=0;j<F;j+=4)ae(this,j,j+3),ae(this,j+1,j+2);return this},c.prototype.swap64=function(){const F=this.length;if(F%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let j=0;j<F;j+=8)ae(this,j,j+7),ae(this,j+1,j+6),ae(this,j+2,j+5),ae(this,j+3,j+4);return this},c.prototype.toString=function(){const F=this.length;return F===0?"":arguments.length===0?we(this,0,F):Q.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(F){if(!c.isBuffer(F))throw new TypeError("Argument must be a Buffer");return this===F?!0:c.compare(this,F)===0},c.prototype.inspect=function(){let F="";const j=O.INSPECT_MAX_BYTES;return F=this.toString("hex",0,j).replace(/(.{2})/g,"$1 ").trim(),this.length>j&&(F+=" ... "),"<Buffer "+F+">"},D&&(c.prototype[D]=c.prototype.inspect),c.prototype.compare=function(F,j,X,te,ue){if(et(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(j===void 0&&(j=0),X===void 0&&(X=F?F.length:0),te===void 0&&(te=0),ue===void 0&&(ue=this.length),j<0||X>F.length||te<0||ue>this.length)throw new RangeError("out of range index");if(te>=ue&&j>=X)return 0;if(te>=ue)return-1;if(j>=X)return 1;if(j>>>=0,X>>>=0,te>>>=0,ue>>>=0,this===F)return 0;let pe=ue-te,Ee=X-j;const Pe=Math.min(pe,Ee),qe=this.slice(te,ue),Ue=F.slice(j,X);for(let Ae=0;Ae<Pe;++Ae)if(qe[Ae]!==Ue[Ae]){pe=qe[Ae],Ee=Ue[Ae];break}return pe<Ee?-1:Ee<pe?1:0};function he(K,F,j,X,te){if(K.length===0)return-1;if(typeof j=="string"?(X=j,j=0):j>2147483647?j=2147483647:j<-2147483648&&(j=-2147483648),j=+j,Qt(j)&&(j=te?0:K.length-1),j<0&&(j=K.length+j),j>=K.length){if(te)return-1;j=K.length-1}else if(j<0)if(te)j=0;else return-1;if(typeof F=="string"&&(F=c.from(F,X)),c.isBuffer(F))return F.length===0?-1:ce(K,F,j,X,te);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(K,F,j):Uint8Array.prototype.lastIndexOf.call(K,F,j):ce(K,[F],j,X,te);throw new TypeError("val must be string, number or Buffer")}function ce(K,F,j,X,te){let ue=1,pe=K.length,Ee=F.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(K.length<2||F.length<2)return-1;ue=2,pe/=2,Ee/=2,j/=2}function Pe(Ue,Ae){return ue===1?Ue[Ae]:Ue.readUInt16BE(Ae*ue)}let qe;if(te){let Ue=-1;for(qe=j;qe<pe;qe++)if(Pe(K,qe)===Pe(F,Ue===-1?0:qe-Ue)){if(Ue===-1&&(Ue=qe),qe-Ue+1===Ee)return Ue*ue}else Ue!==-1&&(qe-=qe-Ue),Ue=-1}else for(j+Ee>pe&&(j=pe-Ee),qe=j;qe>=0;qe--){let Ue=!0;for(let Ae=0;Ae<Ee;Ae++)if(Pe(K,qe+Ae)!==Pe(F,Ae)){Ue=!1;break}if(Ue)return qe}return-1}c.prototype.includes=function(F,j,X){return this.indexOf(F,j,X)!==-1},c.prototype.indexOf=function(F,j,X){return he(this,F,j,X,!0)},c.prototype.lastIndexOf=function(F,j,X){return he(this,F,j,X,!1)};function fe(K,F,j,X){j=Number(j)||0;const te=K.length-j;X?(X=Number(X),X>te&&(X=te)):X=te;const ue=F.length;X>ue/2&&(X=ue/2);let pe;for(pe=0;pe<X;++pe){const Ee=parseInt(F.substr(pe*2,2),16);if(Qt(Ee))return pe;K[j+pe]=Ee}return pe}function me(K,F,j,X){return Bt(ot(F,K.length-j),K,j,X)}function ee(K,F,j,X){return Bt(mt(F),K,j,X)}function le(K,F,j,X){return Bt(At(F),K,j,X)}function ve(K,F,j,X){return Bt(Xt(F,K.length-j),K,j,X)}c.prototype.write=function(F,j,X,te){if(j===void 0)te="utf8",X=this.length,j=0;else if(X===void 0&&typeof j=="string")te=j,X=this.length,j=0;else if(isFinite(j))j=j>>>0,isFinite(X)?(X=X>>>0,te===void 0&&(te="utf8")):(te=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-j;if((X===void 0||X>ue)&&(X=ue),F.length>0&&(X<0||j<0)||j>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let pe=!1;for(;;)switch(te){case"hex":return fe(this,F,j,X);case"utf8":case"utf-8":return me(this,F,j,X);case"ascii":case"latin1":case"binary":return ee(this,F,j,X);case"base64":return le(this,F,j,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ve(this,F,j,X);default:if(pe)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),pe=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function be(K,F,j){return F===0&&j===K.length?N.fromByteArray(K):N.fromByteArray(K.slice(F,j))}function we(K,F,j){j=Math.min(K.length,j);const X=[];let te=F;for(;te<j;){const ue=K[te];let pe=null,Ee=ue>239?4:ue>223?3:ue>191?2:1;if(te+Ee<=j){let Pe,qe,Ue,Ae;switch(Ee){case 1:ue<128&&(pe=ue);break;case 2:Pe=K[te+1],(Pe&192)===128&&(Ae=(ue&31)<<6|Pe&63,Ae>127&&(pe=Ae));break;case 3:Pe=K[te+1],qe=K[te+2],(Pe&192)===128&&(qe&192)===128&&(Ae=(ue&15)<<12|(Pe&63)<<6|qe&63,Ae>2047&&(Ae<55296||Ae>57343)&&(pe=Ae));break;case 4:Pe=K[te+1],qe=K[te+2],Ue=K[te+3],(Pe&192)===128&&(qe&192)===128&&(Ue&192)===128&&(Ae=(ue&15)<<18|(Pe&63)<<12|(qe&63)<<6|Ue&63,Ae>65535&&Ae<1114112&&(pe=Ae))}}pe===null?(pe=65533,Ee=1):pe>65535&&(pe-=65536,X.push(pe>>>10&1023|55296),pe=56320|pe&1023),X.push(pe),te+=Ee}return Ne(X)}const $e=4096;function Ne(K){const F=K.length;if(F<=$e)return String.fromCharCode.apply(String,K);let j="",X=0;for(;X<F;)j+=String.fromCharCode.apply(String,K.slice(X,X+=$e));return j}function Le(K,F,j){let X="";j=Math.min(K.length,j);for(let te=F;te<j;++te)X+=String.fromCharCode(K[te]&127);return X}function Fe(K,F,j){let X="";j=Math.min(K.length,j);for(let te=F;te<j;++te)X+=String.fromCharCode(K[te]);return X}function We(K,F,j){const X=K.length;(!F||F<0)&&(F=0),(!j||j<0||j>X)&&(j=X);let te="";for(let ue=F;ue<j;++ue)te+=nn[K[ue]];return te}function ft(K,F,j){const X=K.slice(F,j);let te="";for(let ue=0;ue<X.length-1;ue+=2)te+=String.fromCharCode(X[ue]+X[ue+1]*256);return te}c.prototype.slice=function(F,j){const X=this.length;F=~~F,j=j===void 0?X:~~j,F<0?(F+=X,F<0&&(F=0)):F>X&&(F=X),j<0?(j+=X,j<0&&(j=0)):j>X&&(j=X),j<F&&(j=F);const te=this.subarray(F,j);return Object.setPrototypeOf(te,c.prototype),te};function Re(K,F,j){if(K%1!==0||K<0)throw new RangeError("offset is not uint");if(K+F>j)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(F,j,X){F=F>>>0,j=j>>>0,X||Re(F,j,this.length);let te=this[F],ue=1,pe=0;for(;++pe<j&&(ue*=256);)te+=this[F+pe]*ue;return te},c.prototype.readUintBE=c.prototype.readUIntBE=function(F,j,X){F=F>>>0,j=j>>>0,X||Re(F,j,this.length);let te=this[F+--j],ue=1;for(;j>0&&(ue*=256);)te+=this[F+--j]*ue;return te},c.prototype.readUint8=c.prototype.readUInt8=function(F,j){return F=F>>>0,j||Re(F,1,this.length),this[F]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(F,j){return F=F>>>0,j||Re(F,2,this.length),this[F]|this[F+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(F,j){return F=F>>>0,j||Re(F,2,this.length),this[F]<<8|this[F+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},c.prototype.readBigUInt64LE=yt(function(F){F=F>>>0,De(F,"offset");const j=this[F],X=this[F+7];(j===void 0||X===void 0)&&je(F,this.length-8);const te=j+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,ue=this[++F]+this[++F]*2**8+this[++F]*2**16+X*2**24;return BigInt(te)+(BigInt(ue)<<BigInt(32))}),c.prototype.readBigUInt64BE=yt(function(F){F=F>>>0,De(F,"offset");const j=this[F],X=this[F+7];(j===void 0||X===void 0)&&je(F,this.length-8);const te=j*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],ue=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+X;return(BigInt(te)<<BigInt(32))+BigInt(ue)}),c.prototype.readIntLE=function(F,j,X){F=F>>>0,j=j>>>0,X||Re(F,j,this.length);let te=this[F],ue=1,pe=0;for(;++pe<j&&(ue*=256);)te+=this[F+pe]*ue;return ue*=128,te>=ue&&(te-=Math.pow(2,8*j)),te},c.prototype.readIntBE=function(F,j,X){F=F>>>0,j=j>>>0,X||Re(F,j,this.length);let te=j,ue=1,pe=this[F+--te];for(;te>0&&(ue*=256);)pe+=this[F+--te]*ue;return ue*=128,pe>=ue&&(pe-=Math.pow(2,8*j)),pe},c.prototype.readInt8=function(F,j){return F=F>>>0,j||Re(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},c.prototype.readInt16LE=function(F,j){F=F>>>0,j||Re(F,2,this.length);const X=this[F]|this[F+1]<<8;return X&32768?X|4294901760:X},c.prototype.readInt16BE=function(F,j){F=F>>>0,j||Re(F,2,this.length);const X=this[F+1]|this[F]<<8;return X&32768?X|4294901760:X},c.prototype.readInt32LE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},c.prototype.readInt32BE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},c.prototype.readBigInt64LE=yt(function(F){F=F>>>0,De(F,"offset");const j=this[F],X=this[F+7];(j===void 0||X===void 0)&&je(F,this.length-8);const te=this[F+4]+this[F+5]*2**8+this[F+6]*2**16+(X<<24);return(BigInt(te)<<BigInt(32))+BigInt(j+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24)}),c.prototype.readBigInt64BE=yt(function(F){F=F>>>0,De(F,"offset");const j=this[F],X=this[F+7];(j===void 0||X===void 0)&&je(F,this.length-8);const te=(j<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(te)<<BigInt(32))+BigInt(this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+X)}),c.prototype.readFloatLE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),$.read(this,F,!0,23,4)},c.prototype.readFloatBE=function(F,j){return F=F>>>0,j||Re(F,4,this.length),$.read(this,F,!1,23,4)},c.prototype.readDoubleLE=function(F,j){return F=F>>>0,j||Re(F,8,this.length),$.read(this,F,!0,52,8)},c.prototype.readDoubleBE=function(F,j){return F=F>>>0,j||Re(F,8,this.length),$.read(this,F,!1,52,8)};function xe(K,F,j,X,te,ue){if(!c.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>te||F<ue)throw new RangeError('"value" argument is out of bounds');if(j+X>K.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(F,j,X,te){if(F=+F,j=j>>>0,X=X>>>0,!te){const Ee=Math.pow(2,8*X)-1;xe(this,F,j,X,Ee,0)}let ue=1,pe=0;for(this[j]=F&255;++pe<X&&(ue*=256);)this[j+pe]=F/ue&255;return j+X},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(F,j,X,te){if(F=+F,j=j>>>0,X=X>>>0,!te){const Ee=Math.pow(2,8*X)-1;xe(this,F,j,X,Ee,0)}let ue=X-1,pe=1;for(this[j+ue]=F&255;--ue>=0&&(pe*=256);)this[j+ue]=F/pe&255;return j+X},c.prototype.writeUint8=c.prototype.writeUInt8=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,1,255,0),this[j]=F&255,j+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,2,65535,0),this[j]=F&255,this[j+1]=F>>>8,j+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,2,65535,0),this[j]=F>>>8,this[j+1]=F&255,j+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,4,4294967295,0),this[j+3]=F>>>24,this[j+2]=F>>>16,this[j+1]=F>>>8,this[j]=F&255,j+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,4,4294967295,0),this[j]=F>>>24,this[j+1]=F>>>16,this[j+2]=F>>>8,this[j+3]=F&255,j+4};function it(K,F,j,X,te){Ie(F,X,te,K,j,7);let ue=Number(F&BigInt(4294967295));K[j++]=ue,ue=ue>>8,K[j++]=ue,ue=ue>>8,K[j++]=ue,ue=ue>>8,K[j++]=ue;let pe=Number(F>>BigInt(32)&BigInt(4294967295));return K[j++]=pe,pe=pe>>8,K[j++]=pe,pe=pe>>8,K[j++]=pe,pe=pe>>8,K[j++]=pe,j}function Me(K,F,j,X,te){Ie(F,X,te,K,j,7);let ue=Number(F&BigInt(4294967295));K[j+7]=ue,ue=ue>>8,K[j+6]=ue,ue=ue>>8,K[j+5]=ue,ue=ue>>8,K[j+4]=ue;let pe=Number(F>>BigInt(32)&BigInt(4294967295));return K[j+3]=pe,pe=pe>>8,K[j+2]=pe,pe=pe>>8,K[j+1]=pe,pe=pe>>8,K[j]=pe,j+8}c.prototype.writeBigUInt64LE=yt(function(F,j=0){return it(this,F,j,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=yt(function(F,j=0){return Me(this,F,j,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(F,j,X,te){if(F=+F,j=j>>>0,!te){const Pe=Math.pow(2,8*X-1);xe(this,F,j,X,Pe-1,-Pe)}let ue=0,pe=1,Ee=0;for(this[j]=F&255;++ue<X&&(pe*=256);)F<0&&Ee===0&&this[j+ue-1]!==0&&(Ee=1),this[j+ue]=(F/pe>>0)-Ee&255;return j+X},c.prototype.writeIntBE=function(F,j,X,te){if(F=+F,j=j>>>0,!te){const Pe=Math.pow(2,8*X-1);xe(this,F,j,X,Pe-1,-Pe)}let ue=X-1,pe=1,Ee=0;for(this[j+ue]=F&255;--ue>=0&&(pe*=256);)F<0&&Ee===0&&this[j+ue+1]!==0&&(Ee=1),this[j+ue]=(F/pe>>0)-Ee&255;return j+X},c.prototype.writeInt8=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,1,127,-128),F<0&&(F=255+F+1),this[j]=F&255,j+1},c.prototype.writeInt16LE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,2,32767,-32768),this[j]=F&255,this[j+1]=F>>>8,j+2},c.prototype.writeInt16BE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,2,32767,-32768),this[j]=F>>>8,this[j+1]=F&255,j+2},c.prototype.writeInt32LE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,4,2147483647,-2147483648),this[j]=F&255,this[j+1]=F>>>8,this[j+2]=F>>>16,this[j+3]=F>>>24,j+4},c.prototype.writeInt32BE=function(F,j,X){return F=+F,j=j>>>0,X||xe(this,F,j,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[j]=F>>>24,this[j+1]=F>>>16,this[j+2]=F>>>8,this[j+3]=F&255,j+4},c.prototype.writeBigInt64LE=yt(function(F,j=0){return it(this,F,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=yt(function(F,j=0){return Me(this,F,j,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(K,F,j,X,te,ue){if(j+X>K.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("Index out of range")}function rt(K,F,j,X,te){return F=+F,j=j>>>0,te||Ke(K,F,j,4),$.write(K,F,j,X,23,4),j+4}c.prototype.writeFloatLE=function(F,j,X){return rt(this,F,j,!0,X)},c.prototype.writeFloatBE=function(F,j,X){return rt(this,F,j,!1,X)};function Ye(K,F,j,X,te){return F=+F,j=j>>>0,te||Ke(K,F,j,8),$.write(K,F,j,X,52,8),j+8}c.prototype.writeDoubleLE=function(F,j,X){return Ye(this,F,j,!0,X)},c.prototype.writeDoubleBE=function(F,j,X){return Ye(this,F,j,!1,X)},c.prototype.copy=function(F,j,X,te){if(!c.isBuffer(F))throw new TypeError("argument should be a Buffer");if(X||(X=0),!te&&te!==0&&(te=this.length),j>=F.length&&(j=F.length),j||(j=0),te>0&&te<X&&(te=X),te===X||F.length===0||this.length===0)return 0;if(j<0)throw new RangeError("targetStart out of bounds");if(X<0||X>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),F.length-j<te-X&&(te=F.length-j+X);const ue=te-X;return this===F&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(j,X,te):Uint8Array.prototype.set.call(F,this.subarray(X,te),j),ue},c.prototype.fill=function(F,j,X,te){if(typeof F=="string"){if(typeof j=="string"?(te=j,j=0,X=this.length):typeof X=="string"&&(te=X,X=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!c.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(F.length===1){const pe=F.charCodeAt(0);(te==="utf8"&&pe<128||te==="latin1")&&(F=pe)}}else typeof F=="number"?F=F&255:typeof F=="boolean"&&(F=Number(F));if(j<0||this.length<j||this.length<X)throw new RangeError("Out of range index");if(X<=j)return this;j=j>>>0,X=X===void 0?this.length:X>>>0,F||(F=0);let ue;if(typeof F=="number")for(ue=j;ue<X;++ue)this[ue]=F;else{const pe=c.isBuffer(F)?F:c.from(F,te),Ee=pe.length;if(Ee===0)throw new TypeError('The value "'+F+'" is invalid for argument "value"');for(ue=0;ue<X-j;++ue)this[ue+j]=pe[ue%Ee]}return this};const He={};function ge(K,F,j){He[K]=class extends j{constructor(){super(),Object.defineProperty(this,"message",{value:F.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${K}]`,this.stack,delete this.name}get code(){return K}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${K}]: ${this.message}`}}}ge("ERR_BUFFER_OUT_OF_BOUNDS",function(K){return K?`${K} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ge("ERR_INVALID_ARG_TYPE",function(K,F){return`The "${K}" argument must be of type number. Received type ${typeof F}`},TypeError),ge("ERR_OUT_OF_RANGE",function(K,F,j){let X=`The value of "${K}" is out of range.`,te=j;return Number.isInteger(j)&&Math.abs(j)>2**32?te=_e(String(j)):typeof j=="bigint"&&(te=String(j),(j>BigInt(2)**BigInt(32)||j<-(BigInt(2)**BigInt(32)))&&(te=_e(te)),te+="n"),X+=` It must be ${F}. Received ${te}`,X},RangeError);function _e(K){let F="",j=K.length;const X=K[0]==="-"?1:0;for(;j>=X+4;j-=3)F=`_${K.slice(j-3,j)}${F}`;return`${K.slice(0,j)}${F}`}function Se(K,F,j){De(F,"offset"),(K[F]===void 0||K[F+j]===void 0)&&je(F,K.length-(j+1))}function Ie(K,F,j,X,te,ue){if(K>j||K<F){const pe=typeof F=="bigint"?"n":"";let Ee;throw F===0||F===BigInt(0)?Ee=`>= 0${pe} and < 2${pe} ** ${(ue+1)*8}${pe}`:Ee=`>= -(2${pe} ** ${(ue+1)*8-1}${pe}) and < 2 ** ${(ue+1)*8-1}${pe}`,new He.ERR_OUT_OF_RANGE("value",Ee,K)}Se(X,te,ue)}function De(K,F){if(typeof K!="number")throw new He.ERR_INVALID_ARG_TYPE(F,"number",K)}function je(K,F,j){throw Math.floor(K)!==K?(De(K,j),new He.ERR_OUT_OF_RANGE("offset","an integer",K)):F<0?new He.ERR_BUFFER_OUT_OF_BOUNDS:new He.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,K)}const Je=/[^+/0-9A-Za-z-_]/g;function Ze(K){if(K=K.split("=")[0],K=K.trim().replace(Je,""),K.length<2)return"";for(;K.length%4!==0;)K=K+"=";return K}function ot(K,F){F=F||1/0;let j;const X=K.length;let te=null;const ue=[];for(let pe=0;pe<X;++pe){if(j=K.charCodeAt(pe),j>55295&&j<57344){if(!te){if(j>56319){(F-=3)>-1&&ue.push(239,191,189);continue}else if(pe+1===X){(F-=3)>-1&&ue.push(239,191,189);continue}te=j;continue}if(j<56320){(F-=3)>-1&&ue.push(239,191,189),te=j;continue}j=(te-55296<<10|j-56320)+65536}else te&&(F-=3)>-1&&ue.push(239,191,189);if(te=null,j<128){if((F-=1)<0)break;ue.push(j)}else if(j<2048){if((F-=2)<0)break;ue.push(j>>6|192,j&63|128)}else if(j<65536){if((F-=3)<0)break;ue.push(j>>12|224,j>>6&63|128,j&63|128)}else if(j<1114112){if((F-=4)<0)break;ue.push(j>>18|240,j>>12&63|128,j>>6&63|128,j&63|128)}else throw new Error("Invalid code point")}return ue}function mt(K){const F=[];for(let j=0;j<K.length;++j)F.push(K.charCodeAt(j)&255);return F}function Xt(K,F){let j,X,te;const ue=[];for(let pe=0;pe<K.length&&!((F-=2)<0);++pe)j=K.charCodeAt(pe),X=j>>8,te=j%256,ue.push(te),ue.push(X);return ue}function At(K){return N.toByteArray(Ze(K))}function Bt(K,F,j,X){let te;for(te=0;te<X&&!(te+j>=F.length||te>=K.length);++te)F[te+j]=K[te];return te}function et(K,F){return K instanceof F||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===F.name}function Qt(K){return K!==K}const nn=function(){const K="0123456789abcdef",F=new Array(256);for(let j=0;j<16;++j){const X=j*16;for(let te=0;te<16;++te)F[X+te]=K[j]+K[te]}return F}();function yt(K){return typeof BigInt>"u"?rn:K}function rn(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var O=toolsEbml&&toolsEbml.__assign||function(){return O=Object.assign||function(b){for(var k,i=1,c=arguments.length;i<c;i++){k=arguments[i];for(var S in k)Object.prototype.hasOwnProperty.call(k,S)&&(b[S]=k[S])}return b},O.apply(this,arguments)},N=toolsEbml&&toolsEbml.__spreadArray||function(b,k,i){if(i||arguments.length===2)for(var c=0,S=k.length,C;c<S;c++)(C||!(c in k))&&(C||(C=Array.prototype.slice.call(k,0,c)),C[c]=k[c]);return b.concat(C||Array.prototype.slice.call(k))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var $=requireTools(),D=function(){function b(){}return b.readVint=function(k,i){i===void 0&&(i=0);var c=8-Math.floor(Math.log2(k[i]));if(c>8){var S=b.readHexString(k,i,i+c);throw new Error("Unrepresentable length: ".concat(c," ").concat(S))}if(i+c>k.length)return null;for(var C=k[i]&(1<<8-c)-1,M=1;M<c;M+=1){if(M===7&&C>=Math.pow(2,8)&&k[i+7]>0)return{length:c,value:-1};C*=Math.pow(2,8),C+=k[i+M]}return{length:c,value:C}},b.writeVint=function(k){if(k<0||k>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(k));var i=1;for(i=1;i<=8&&!(k<Math.pow(2,7*i)-1);i+=1);for(var c=$.Buffer.alloc(i),S=k,C=1;C<=i;C+=1){var M=S&255;c[i-C]=M,S-=M,S/=Math.pow(2,8)}return c[0]|=1<<8-i,c},b.concatenate=function(k,i){return!k&&!i?$.Buffer.from([]):!k||k.byteLength===0?i:!i||i.byteLength===0?k:$.Buffer.from(N(N([],k,!0),i,!0))},b.readHexString=function(k,i,c){return i===void 0&&(i=0),c===void 0&&(c=k.byteLength),Array.from(k.slice(i,c)).map(function(S){return Number(S).toString(16)}).reduce(function(S,C){return"".concat(S).concat(C.padStart(2,"0"))},"")},b.readUtf8=function(k){try{return $.Buffer.from(k).toString("utf8")}catch{return null}},b.readUnsigned=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return k.byteLength<=6?k.reduce(function(c,S){return c*256+S},0):b.readHexString(k,0,k.byteLength)},b.readSigned=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},b.readFloat=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},b.readDate=function(k){var i=new DataView(k.buffer,k.byteOffset,k.byteLength);switch(k.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(b.readHexString(k),16));default:return new Date(0)}},b.readDataFromTag=function(k,i){var c=k.type,S=k.name,C=k.track,M=k.discardable||!1,Z=k.keyframe||!1,J=null,z;switch(c){case"u":z=b.readUnsigned(i);break;case"f":z=b.readFloat(i);break;case"i":z=b.readSigned(i);break;case"s":z=String.fromCharCode.apply(String,i);break;case"8":z=b.readUtf8(i);break;case"d":z=b.readDate(i);break}if(S==="SimpleBlock"||S==="Block"){var Y=0,re=b.readVint(i,Y),oe=re.length,ie=re.value;Y+=oe,C=ie,z=b.readSigned(i.subarray(Y,Y+2)),Y+=2,S==="SimpleBlock"&&(Z=!!(i[oe+2]&128),M=!!(i[oe+2]&1)),Y+=1,J=i.subarray(Y)}return O(O({},k),{data:i,discardable:M,keyframe:Z,payload:J,track:C,value:z})},b}();return toolsEbml.default=D,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(O,N,$){N=N||0;for(var D=1;D<=8&&!(O[N]>=Math.pow(2,8-D));D++);if(D>8)throw new Error("Unrepresentable length: "+D+" "+O.toString("hex",N,N+D));if(N+D>O.length)return null;var b,k=O[N]&(1<<8-D)-1;for(b=1;b<D;b++){if(b===7&&k>=Math.pow(2,45)&&O[N+7]>0)return{length:D,value:-1};k*=Math.pow(2,8),k+=O[N+b]}return $&&(k-=Math.pow(2,D*7-1)-1),{length:D,value:k}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var O=requireVint();function N($){this.buffer=$,this.offset=0}return N.prototype.nextInt16BE=function(){var $=this.buffer.readInt16BE(this.offset);return this.offset+=2,$},N.prototype.nextUInt8=function(){var $=this.buffer.readUInt8(this.offset);return this.offset+=1,$},N.prototype.nextUIntV=function(){var $=O(this.buffer,this.offset);return this.offset+=$.length,$.value},N.prototype.nextIntV=function(){var $=O(this.buffer,this.offset,!0);return this.offset+=$.length,$.value},N.prototype.nextBuffer=function($){var D=$?this.buffer.slice(this.offset,this.offset+$):this.buffer.slice(this.offset);return this.offset+=$||this.length,D},Object.defineProperty(N.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=N,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var O=requireBufferReader(),N=1,$=3,D=2;ebmlBlock=function(k){var i={},c=new O(k);i.trackNumber=c.nextUIntV(),i.timecode=c.nextInt16BE();var S=c.nextUInt8();i.invisible=!!(S&8),i.keyframe=!!(S&128),i.discardable=!!(S&1);var C=(S&6)>>1;return i.frames=b(c,C),i};function b(k,i){if(!i)return[k.nextBuffer()];var c,S,C=[],M=k.nextUInt8()+1;if(i===D){if(k.length%M!==0)throw new Error("Fixed-Size Lacing Error");for(S=k.length/M,c=0;c<M;c++)C.push(k.nextBuffer(S));return C}var Z=[];if(i===N)for(c=0;c<M-1;c++){var J;S=0;do J=k.nextUInt8(),S+=J;while(J===255);Z.push(S)}else if(i===$)for(S=k.nextUIntV(),Z.push(S),c=1;c<M-1;c++)S+=k.nextIntV(),Z.push(S);for(c=0;c<M-1;c++)C.push(k.nextBuffer(Z[c]));return C.push(k.nextBuffer()),C}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(O){Object.defineProperty(O,"__esModule",{value:!0}),O.convertEBMLDateToJSDate=O.createFloatBuffer=O.createIntBuffer=O.createUIntBuffer=O.encodeValueToBuffer=O.concat=O.putRefinedMetaData=O.extractElement=O.removeElement=O.makeMetadataSeekable=O.createRIFFChunk=O.VP8BitStreamToRiffWebPBuffer=O.WebPBlockFilter=O.encodeTag=O.readBlock=O.ebmlBlock=O.writeVint=O.readVint=O.Buffer=void 0;var N=requireInt64Buffer(),$=requireEBMLEncoder(),D=requireBuffer(),b=requireToolsEbml(),k=requireEbmlBlock();O.Buffer=D.Buffer,O.readVint=b.default.readVint,O.writeVint=b.default.writeVint,O.ebmlBlock=k;function i(ee){return(0,O.ebmlBlock)(new O.Buffer(ee))}O.readBlock=i;function c(ee,le,ve){return ve===void 0&&(ve=!1),Q([ee,ve?new O.Buffer("01ffffffffffffff","hex"):(0,O.writeVint)(le.length),le])}O.encodeTag=c;function S(ee){return ee.reduce(function(le,ve){if(ve.type!=="b"||ve.name!=="SimpleBlock")return le;var be=(0,O.ebmlBlock)(ve.data),we=be.frames.some(function($e){var Ne=$e.slice(3,6).toString("hex");return Ne==="9d012a"});return we?le.concat(ve):le},[])}O.WebPBlockFilter=S;function C(ee){var le=M("VP8 ",ee),ve=Q([new O.Buffer("WEBP","ascii"),le]);return M("RIFF",ve)}O.VP8BitStreamToRiffWebPBuffer=C;function M(ee,le){var ve=new O.Buffer(4);return ve.writeUInt32LE(le.byteLength,0),Q([new O.Buffer(ee.substr(0,4),"ascii"),ve,le,new O.Buffer(le.byteLength%2===0?0:1)])}O.createRIFFChunk=M;function Z(ee,le,ve){var be=z("EBML",ee),we=re(be),$e=we+12,Ne=ee[ee.length-1].dataEnd-$e,Le=z("Info",ee);J("Duration",Le),Le.splice(1,0,{name:"Duration",type:"f",data:fe(le,8)});for(var Fe=re(Le),We=z("Tracks",ee),ft=re(We),Re=47,xe=[],it=5+ve.length*15,Me=[],Ke=-1,rt=10,Ye=function(Ie){var De=Re,je=De+Fe,Je=je+ft,Ze=Je+it,ot=Ze-Ne;if(xe=[],xe.push({name:"SeekHead",type:"m",isEnd:!1}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([21,73,169,102])}),xe.push({name:"SeekPosition",type:"u",data:he(De)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([22,84,174,107])}),xe.push({name:"SeekPosition",type:"u",data:he(je)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"Seek",type:"m",isEnd:!1}),xe.push({name:"SeekID",type:"b",data:new O.Buffer([28,83,187,107])}),xe.push({name:"SeekPosition",type:"u",data:he(Je)}),xe.push({name:"Seek",type:"m",isEnd:!0}),xe.push({name:"SeekHead",type:"m",isEnd:!0}),Re=re(xe),Me=[],Me.push({name:"Cues",type:"m",isEnd:!1}),ve.forEach(function(mt){var Xt=mt.CueTrack,At=mt.CueClusterPosition,Bt=mt.CueTime;Me.push({name:"CuePoint",type:"m",isEnd:!1}),Me.push({name:"CueTime",type:"u",data:he(Bt)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Me.push({name:"CueTrack",type:"u",data:he(Xt)}),At-=$e,At+=ot,Me.push({name:"CueClusterPosition",type:"u",data:he(At)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Me.push({name:"CuePoint",type:"m",isEnd:!0})}),Me.push({name:"Cues",type:"m",isEnd:!0}),it=re(Me),Ke!==ot){if(Ke=ot,Ie===rt-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},He=0;He<rt;He++){var ge=Ye(He);if(ge==="break")break}var _e=[].concat.apply([],[be,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},xe,Le,We,Me]),Se=new $.default().encode(_e);return Se}O.makeMetadataSeekable=Z;function J(ee,le){for(var ve=-1,be=0;be<le.length;be++){var we=le[be];if(we.name===ee)if(we.type==="m")if(!we.isEnd)ve=be;else{if(ve==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));le.splice(ve,be-ve+1);return}else{le.splice(be,1);return}}}O.removeElement=J;function z(ee,le){for(var ve=[],be=-1,we=0;we<le.length;we++){var $e=le[we];if($e.name===ee)if($e.type==="m")if(!$e.isEnd)be=we;else{if(be==-1)throw new Error("Detected ".concat(ee," closing element before finding the start"));ve=le.slice(be,we+1);break}else{ve.push(le[we]);break}}return ve}O.extractElement=z;function Y(ee,le){Array.isArray(le.cueInfos)&&!Array.isArray(le.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),le.cues=le.cueInfos);for(var ve=[],be=[],we=0;we<ee.length;we++){var $e=ee[we];if($e.type==="m"&&$e.name==="Segment"){if(ve=ee.slice(0,we),be=ee.slice(we),$e.unknownSize){be.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(be[be.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ne=be[be.length-1].dataEnd,Le=ve[ve.length-1].dataEnd,Fe=new $.default().encode(ve).byteLength,We=Fe-Le,ft=Ne-be[0].tagStart;be[0].tagStart-Le,be[0].tagStart;var Re=new O.Buffer([24,83,128,103]),xe=new O.Buffer("01ffffffffffffff","hex"),it=Re.byteLength+xe.byteLength,Me=ft,Ke;for(Ke=1;Ke<20;Ke++){var rt=Le+it+Me,Ye=rt-Ne,He=We+Ye,ge=oe(be,He,le),_e=new $.default().encode(ge).byteLength;if(_e===Me)return new $.default().encode([].concat(ve,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],ge));Me=_e}throw new Error("unable to refine metadata, stable size could not be found in "+Ke+" iterations!")}O.putRefinedMetaData=Y;function re(ee){var le=new $.default;return ee.reduce(function(ve,be){return ve.concat(le.encode([be]))},[]).reduce(function(ve,be){return ve+be.byteLength},0)}function oe(ee,le,ve){var be=ve.duration,we=ve.clusterPtrs,$e=ve.cues,Ne=ee.slice(0);if(typeof be=="number"){var Le=!1;Ne.forEach(function(We){We.type==="f"&&We.name==="Duration"&&(Le=!0,We.data=fe(be,8))}),Le||ye(Ne,"Info",[{name:"Duration",type:"f",data:fe(be,8)}])}Array.isArray($e)&&ye(Ne,"Cues",de($e,le));var Fe=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Fe=ie(we,le)),ye(Ne,"SeekHead",Fe,!0),Ne}function ie(ee,le){var ve=[];return ee.forEach(function(be){ve.push({name:"Seek",type:"m",isEnd:!1}),ve.push({name:"SeekID",type:"b",data:new O.Buffer([31,67,182,117])}),ve.push({name:"SeekPosition",type:"u",data:he(be+le)}),ve.push({name:"Seek",type:"m",isEnd:!0})}),ve}function de(ee,le){var ve=[];return ee.forEach(function(be){var we=be.CueTrack,$e=be.CueClusterPosition,Ne=be.CueTime;ve.push({name:"CuePoint",type:"m",isEnd:!1}),ve.push({name:"CueTime",type:"u",data:he(Ne)}),ve.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ve.push({name:"CueTrack",type:"u",data:he(we)}),ve.push({name:"CueClusterPosition",type:"u",data:he($e+le)}),ve.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ve.push({name:"CuePoint",type:"m",isEnd:!0})}),ve}function ye(ee,le,ve,be){be===void 0&&(be=!1);for(var we=-1,$e=0;$e<ee.length;$e++){var Ne=ee[$e];if(Ne.type==="m"&&Ne.name===le&&Ne.isEnd===!1){we=$e;break}}we>=0?Array.prototype.splice.apply(ee,[we+1,0].concat(ve)):be?[].concat([{name:le,type:"m",isEnd:!1}],ve,[{name:le,type:"m",isEnd:!0}]).reverse().forEach(function(Le){ee.unshift(Le)}):(ee.push({name:le,type:"m",isEnd:!1}),ve.forEach(function(Le){ee.push(Le)}),ee.push({name:le,type:"m",isEnd:!0}))}function Q(ee){return O.Buffer.concat(ee)}O.concat=Q;function ae(ee){var le=new O.Buffer(0);if(ee.type==="m")return ee;switch(ee.type){case"u":le=he(ee.value);break;case"i":le=ce(ee.value);break;case"f":le=fe(ee.value);break;case"s":le=new O.Buffer(ee.value,"ascii");break;case"8":le=new O.Buffer(ee.value,"utf8");break;case"b":le=ee.value;break;case"d":le=new N.Int64BE(ee.value.getTime().toString()).toBuffer();break}return Object.assign({},ee,{data:le})}O.encodeValueToBuffer=ae;function he(ee){for(var le=1;ee>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new N.Uint64BE(ee).toBuffer();var ve=new O.Buffer(le);return ve.writeUIntBE(ee,0,le),ve}O.createUIntBuffer=he;function ce(ee){for(var le=1;ee>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new N.Int64BE(ee).toBuffer();var ve=new O.Buffer(le);return ve.writeIntBE(ee,0,le),ve}O.createIntBuffer=ce;function fe(ee,le){if(le===void 0&&(le=8),le===8){var ve=new O.Buffer(8);return ve.writeDoubleBE(ee,0),ve}else if(le===4){var ve=new O.Buffer(4);return ve.writeFloatBE(ee,0),ve}else throw new Error("float type bits must 4bytes or 8bytes")}O.createFloatBuffer=fe;function me(ee){return ee instanceof Date?ee:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ee)/1e3/1e3)}O.convertEBMLDateToJSDate=me}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var O=requireInt64Buffer(),N=requireTools(),$=requireTools(),D=requireEbmlID(),b;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(b||(b={}));var k=function(){function i(){this._buffer=new N.Buffer(0),this._tag_stack=[],this._state=b.STATE_TAG,this._cursor=0,this._total=0,this._schema=D.byEbmlID,this._result=[]}return i.prototype.decode=function(c){this.readChunk(c);var S=this._result;return this._result=[],S},i.prototype.readChunk=function(c){for(this._buffer=$.concat([this._buffer,new N.Buffer(c)]);this._cursor<this._buffer.length&&!(this._state===b.STATE_TAG&&!this.readTag()||this._state===b.STATE_SIZE&&!this.readSize()||this._state===b.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(c){return this._schema[c]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,N.readVint)(this._buffer,this._cursor);if(c==null)return!1;var S=this._buffer.slice(this._cursor,this._cursor+c.length),C=S.reduce(function(J,z,Y,re){return J+z*Math.pow(16,2*(re.length-1-Y))},0),M=this.getSchemaInfo(C),Z={EBML_ID:C.toString(16),schema:M,type:M.type,name:M.name,level:M.level,tagStart:this._total,tagEnd:this._total+c.length,sizeStart:this._total+c.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(Z),this._cursor+=c.length,this._total+=c.length,this._state=b.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,N.readVint)(this._buffer,this._cursor);if(c==null)return!1;var S=this._tag_stack[this._tag_stack.length-1];return S.sizeEnd=S.sizeStart+c.length,S.dataStart=S.sizeEnd,S.dataSize=c.value,c.value===-1?(S.dataEnd=-1,S.type==="m"&&(S.unknownSize=!0)):S.dataEnd=S.sizeEnd+c.value,this._cursor+=c.length,this._total+=c.length,this._state=b.STATE_CONTENT,!0},i.prototype.readContent=function(){var c=this._tag_stack[this._tag_stack.length-1];if(c.type==="m"){if(c.isEnd=!1,this._result.push(c),this._state=b.STATE_TAG,c.dataSize===0){var S=Object.assign({},c,{isEnd:!0});this._result.push(S),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+c.dataSize)return!1;var C=this._buffer.slice(this._cursor,this._cursor+c.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+c.dataSize),c.data=C,c.type){case"u":c.value=C.readUIntBE(0,C.length);break;case"i":c.value=C.readIntBE(0,C.length);break;case"f":c.value=c.dataSize===4?C.readFloatBE(0):c.dataSize===8?C.readDoubleBE(0):(console.warn("cannot read ".concat(c.dataSize," octets float. failback to 0")),0);break;case"s":c.value=C.toString("ascii");break;case"8":c.value=C.toString("utf8");break;case"b":c.value=C;break;case"d":c.value=(0,N.convertEBMLDateToJSDate)(new O.Int64BE(C).toNumber());break}if(c.value===null)throw new Error("unknown tag type:"+c.type);for(this._result.push(c),this._total+=c.dataSize,this._state=b.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var M=this._tag_stack[this._tag_stack.length-1];if(M.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<M.dataEnd)break;if(M.type!=="m")throw new Error("parent element is not master element");var S=Object.assign({},M,{isEnd:!0});this._result.push(S),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=k,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var O=typeof Reflect=="object"?Reflect:null,N=O&&typeof O.apply=="function"?O.apply:function(ae,he,ce){return Function.prototype.apply.call(ae,he,ce)},$;O&&typeof O.ownKeys=="function"?$=O.ownKeys:Object.getOwnPropertySymbols?$=function(ae){return Object.getOwnPropertyNames(ae).concat(Object.getOwnPropertySymbols(ae))}:$=function(ae){return Object.getOwnPropertyNames(ae)};function D(Q){console&&console.warn&&console.warn(Q)}var b=Number.isNaN||function(ae){return ae!==ae};function k(){k.init.call(this)}events.exports=k,events.exports.once=ie,k.EventEmitter=k,k.prototype._events=void 0,k.prototype._eventsCount=0,k.prototype._maxListeners=void 0;var i=10;function c(Q){if(typeof Q!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof Q)}Object.defineProperty(k,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(Q){if(typeof Q!="number"||Q<0||b(Q))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+Q+".");i=Q}}),k.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},k.prototype.setMaxListeners=function(ae){if(typeof ae!="number"||ae<0||b(ae))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ae+".");return this._maxListeners=ae,this};function S(Q){return Q._maxListeners===void 0?k.defaultMaxListeners:Q._maxListeners}k.prototype.getMaxListeners=function(){return S(this)},k.prototype.emit=function(ae){for(var he=[],ce=1;ce<arguments.length;ce++)he.push(arguments[ce]);var fe=ae==="error",me=this._events;if(me!==void 0)fe=fe&&me.error===void 0;else if(!fe)return!1;if(fe){var ee;if(he.length>0&&(ee=he[0]),ee instanceof Error)throw ee;var le=new Error("Unhandled error."+(ee?" ("+ee.message+")":""));throw le.context=ee,le}var ve=me[ae];if(ve===void 0)return!1;if(typeof ve=="function")N(ve,this,he);else for(var be=ve.length,we=Y(ve,be),ce=0;ce<be;++ce)N(we[ce],this,he);return!0};function C(Q,ae,he,ce){var fe,me,ee;if(c(he),me=Q._events,me===void 0?(me=Q._events=Object.create(null),Q._eventsCount=0):(me.newListener!==void 0&&(Q.emit("newListener",ae,he.listener?he.listener:he),me=Q._events),ee=me[ae]),ee===void 0)ee=me[ae]=he,++Q._eventsCount;else if(typeof ee=="function"?ee=me[ae]=ce?[he,ee]:[ee,he]:ce?ee.unshift(he):ee.push(he),fe=S(Q),fe>0&&ee.length>fe&&!ee.warned){ee.warned=!0;var le=new Error("Possible EventEmitter memory leak detected. "+ee.length+" "+String(ae)+" listeners added. Use emitter.setMaxListeners() to increase limit");le.name="MaxListenersExceededWarning",le.emitter=Q,le.type=ae,le.count=ee.length,D(le)}return Q}k.prototype.addListener=function(ae,he){return C(this,ae,he,!1)},k.prototype.on=k.prototype.addListener,k.prototype.prependListener=function(ae,he){return C(this,ae,he,!0)};function M(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Z(Q,ae,he){var ce={fired:!1,wrapFn:void 0,target:Q,type:ae,listener:he},fe=M.bind(ce);return fe.listener=he,ce.wrapFn=fe,fe}k.prototype.once=function(ae,he){return c(he),this.on(ae,Z(this,ae,he)),this},k.prototype.prependOnceListener=function(ae,he){return c(he),this.prependListener(ae,Z(this,ae,he)),this},k.prototype.removeListener=function(ae,he){var ce,fe,me,ee,le;if(c(he),fe=this._events,fe===void 0)return this;if(ce=fe[ae],ce===void 0)return this;if(ce===he||ce.listener===he)--this._eventsCount===0?this._events=Object.create(null):(delete fe[ae],fe.removeListener&&this.emit("removeListener",ae,ce.listener||he));else if(typeof ce!="function"){for(me=-1,ee=ce.length-1;ee>=0;ee--)if(ce[ee]===he||ce[ee].listener===he){le=ce[ee].listener,me=ee;break}if(me<0)return this;me===0?ce.shift():re(ce,me),ce.length===1&&(fe[ae]=ce[0]),fe.removeListener!==void 0&&this.emit("removeListener",ae,le||he)}return this},k.prototype.off=k.prototype.removeListener,k.prototype.removeAllListeners=function(ae){var he,ce,fe;if(ce=this._events,ce===void 0)return this;if(ce.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ce[ae]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ce[ae]),this;if(arguments.length===0){var me=Object.keys(ce),ee;for(fe=0;fe<me.length;++fe)ee=me[fe],ee!=="removeListener"&&this.removeAllListeners(ee);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(he=ce[ae],typeof he=="function")this.removeListener(ae,he);else if(he!==void 0)for(fe=he.length-1;fe>=0;fe--)this.removeListener(ae,he[fe]);return this};function J(Q,ae,he){var ce=Q._events;if(ce===void 0)return[];var fe=ce[ae];return fe===void 0?[]:typeof fe=="function"?he?[fe.listener||fe]:[fe]:he?oe(fe):Y(fe,fe.length)}k.prototype.listeners=function(ae){return J(this,ae,!0)},k.prototype.rawListeners=function(ae){return J(this,ae,!1)},k.listenerCount=function(Q,ae){return typeof Q.listenerCount=="function"?Q.listenerCount(ae):z.call(Q,ae)},k.prototype.listenerCount=z;function z(Q){var ae=this._events;if(ae!==void 0){var he=ae[Q];if(typeof he=="function")return 1;if(he!==void 0)return he.length}return 0}k.prototype.eventNames=function(){return this._eventsCount>0?$(this._events):[]};function Y(Q,ae){for(var he=new Array(ae),ce=0;ce<ae;++ce)he[ce]=Q[ce];return he}function re(Q,ae){for(;ae+1<Q.length;ae++)Q[ae]=Q[ae+1];Q.pop()}function oe(Q){for(var ae=new Array(Q.length),he=0;he<ae.length;++he)ae[he]=Q[he].listener||Q[he];return ae}function ie(Q,ae){return new Promise(function(he,ce){function fe(ee){Q.removeListener(ae,me),ce(ee)}function me(){typeof Q.removeListener=="function"&&Q.removeListener("error",fe),he([].slice.call(arguments))}ye(Q,ae,me,{once:!0}),ae!=="error"&&de(Q,fe,{once:!0})})}function de(Q,ae,he){typeof Q.on=="function"&&ye(Q,"error",ae,he)}function ye(Q,ae,he,ce){if(typeof Q.on=="function")ce.once?Q.once(ae,he):Q.on(ae,he);else if(typeof Q.addEventListener=="function")Q.addEventListener(ae,function fe(me){ce.once&&Q.removeEventListener(ae,fe),he(me)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof Q)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var O=EBMLReader&&EBMLReader.__extends||function(){var b=function(k,i){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,S){c.__proto__=S}||function(c,S){for(var C in S)Object.prototype.hasOwnProperty.call(S,C)&&(c[C]=S[C])},b(k,i)};return function(k,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");b(k,i);function c(){this.constructor=k}k.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var N=requireEvents(),$=requireTools(),D=function(b){O(k,b);function k(){var i=b.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return k.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},k.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var C=this.lastClusterTimecode,M=this.duration,Z=this.timecodeScale;this.emit("cluster",{timecode:C,data:i}),this.emit("duration",{timecodeScale:Z,duration:M})}else{this.metadataloaded=!0,this.metadatas=i;var c=this.trackTypes.indexOf(1),S=this.trackTypes.indexOf(2);if(this.trackInfo=c>=0&&S>=0?{type:"both",trackNumber:c}:c>=0?{type:"video",trackNumber:c}:S>=0?{type:"audio",trackNumber:S}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},k.prototype.read=function(i){var c=this,S=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var C=this.stack[this.stack.length-1];if(C!=null&&C.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),C.dataEnd=i.dataEnd,C.dataSize=i.dataEnd-C.dataStart,C.unknownSize=!1;var M=Object.assign({},C,{name:C.name,type:C.type,isEnd:!0});this.chunks.push(M)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var Z=$.ebmlBlock(i.data),J=Z.timecode,z=Z.trackNumber,Y=Z.frames;if(this.trackTypes[z]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var re=this.lastClusterTimecode+J;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],J]}else if(this.trackTypes[z]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var re=this.lastClusterTimecode+J;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:re})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],J]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&Y.forEach(function(oe){var ie=oe.slice(3,6).toString("hex");if(ie==="9d012a"){var de=$.VP8BitStreamToRiffWebPBuffer(oe),ye=new Blob([de],{type:"image/webp"}),Q=c.duration;c.emit("webp",{currentTime:Q,webp:ye})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),S=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),S||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(k.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,c=0,S=0,C=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof C=="number")i=C;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof M=="number"&&(c=M),S=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof M=="number"&&(c=M),S=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackInfo.trackNumber];typeof M=="number"&&(c=M),S=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var M=this.trackCodecDelay[this.trackInfo.trackNumber];typeof M=="number"&&(c=M),S=this.last2SimpleBlockAudioTrackTimecode[1]}var Z=(this.lastClusterTimecode+S)*this.timecodeScale+i-c,J=Z/this.timecodeScale;return Math.floor(J)},enumerable:!1,configurable:!0}),k.prototype.addListener=function(i,c){return b.prototype.addListener.call(this,i,c)},k.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},k}(N.EventEmitter);return EBMLReader.default=D,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(O){var N=ebml&&ebml.__createBinding||(Object.create?function(c,S,C,M){M===void 0&&(M=C),Object.defineProperty(c,M,{enumerable:!0,get:function(){return S[C]}})}:function(c,S,C,M){M===void 0&&(M=C),c[M]=S[C]}),$=ebml&&ebml.__exportStar||function(c,S){for(var C in c)C!=="default"&&!Object.prototype.hasOwnProperty.call(S,C)&&N(S,c,C)};Object.defineProperty(O,"__esModule",{value:!0}),O.tools=O.Reader=O.Encoder=O.Decoder=void 0,$(requireEBML(),O);var D=requireEBMLDecoder();O.Decoder=D.default;var b=requireEBMLEncoder();O.Encoder=b.default;var k=requireEBMLReader();O.Reader=k.default;var i=requireTools();O.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var O=lib&&lib.__awaiter||function(b,k,i,c){function S(C){return C instanceof i?C:new i(function(M){M(C)})}return new(i||(i=Promise))(function(C,M){function Z(Y){try{z(c.next(Y))}catch(re){M(re)}}function J(Y){try{z(c.throw(Y))}catch(re){M(re)}}function z(Y){Y.done?C(Y.value):S(Y.value).then(Z,J)}z((c=c.apply(b,k||[])).next())})},N=lib&&lib.__generator||function(b,k){var i={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},c,S,C,M;return M={next:Z(0),throw:Z(1),return:Z(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function Z(z){return function(Y){return J([z,Y])}}function J(z){if(c)throw new TypeError("Generator is already executing.");for(;i;)try{if(c=1,S&&(C=z[0]&2?S.return:z[0]?S.throw||((C=S.return)&&C.call(S),0):S.next)&&!(C=C.call(S,z[1])).done)return C;switch(S=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return i.label++,{value:z[1],done:!1};case 5:i.label++,S=z[1],z=[0];continue;case 7:z=i.ops.pop(),i.trys.pop();continue;default:if(C=i.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){i=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){i.label=z[1];break}if(z[0]===6&&i.label<C[1]){i.label=C[1],C=z;break}if(C&&i.label<C[2]){i.label=C[2],i.ops.push(z);break}C[2]&&i.ops.pop(),i.trys.pop();continue}z=k.call(b,i)}catch(Y){z=[6,Y],S=0}finally{c=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var $=requireEbml();function D(b){return O(this,void 0,void 0,function(){var k,i,c,S,C,M,Z,J,z,Y,re,oe;return N(this,function(ie){switch(ie.label){case 0:if(!b)throw Error("call to fixWebmDuration requires a blob");k=new $.Decoder,i=new $.Reader,c=b.stream(),S=c.getReader(),ie.label=1;case 1:return[4,S.read()];case 2:return C=ie.sent(),M=C.done,Z=C.value,M?(i.stop(),[3,3]):(J=k.decode(Z),J=J==null?void 0:J.filter(function(de){return de.type!=="unknown"}),J.forEach(function(de){i.read(de)}),Z=null,[3,1]);case 3:return z=$.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),Y=new Blob([z],{type:b.type}),re=b.slice(i.metadataSize),oe=new Blob([Y,re],{type:b.type}),[2,oe]}})})}return lib.default=D,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){ke(this,Ve);ke(this,vt,!1);ke(this,st,!1);ke(this,qt,0);ke(this,Nt,0);ke(this,Xe,0);ke(this,tt,0);ke(this,bt,0);ne(this,"onchange",N=>{});ne(this,"onDurationChange",N=>{});ne(this,"start",async(N="")=>{N||(N=`video_Record_${E(Date.now())}`);let $=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(D=>{const b=D.getTracks();for(const i of b)i.onended=()=>this.stop();Be(this,vt,!0),Be(this,st,!1),Be(this,Ve,new MediaRecorder(D)),se(this,Ve).start();const k=new Date().getTime();Be(this,qt,k),Be(this,Xe,k),se(this,kt).call(this),se(this,Pt).call(this),se(this,Ve).addEventListener("dataavailable",i=>{$.push(i.data)}),se(this,Ve).addEventListener("stop",async()=>{Be(this,vt,!1);const i=new Date().getTime();Be(this,Nt,i),Be(this,tt,se(this,tt)+(i-se(this,Xe))),se(this,kt).call(this),clearInterval(se(this,bt));const c=D.getTracks();for(const J of c)J.stop();if(se(this,Ve)===null)return;const S=new Blob($,{type:se(this,Ve).mimeType}),C=await fixWebmDuration(S),M=URL.createObjectURL(C),Z=document.createElement("a");Z.href=M,Z.download=`${N}.mp4`,Z.click(),URL.revokeObjectURL(M),$=[],Be(this,Ve,null)})})});ne(this,"pause",async()=>{var $;await new Promise(D=>setTimeout(()=>D(!0),300)),($=se(this,Ve))==null||$.pause(),Be(this,st,!0);const N=new Date().getTime();Be(this,tt,se(this,tt)+(N-se(this,Xe))),se(this,kt).call(this),clearInterval(se(this,bt))});ne(this,"resume",async()=>{var $;($=se(this,Ve))==null||$.resume(),Be(this,st,!1);const N=new Date().getTime();Be(this,Xe,N),se(this,kt).call(this),se(this,Pt).call(this)});ne(this,"stop",async()=>{var N;(N=se(this,Ve))==null||N.stop()});ne(this,"getDuration",()=>{if(se(this,Xe)===0)return 0;let N=se(this,tt);const $=new Date().getTime();if(se(this,vt)&&se(this,st)===!1){const D=$-se(this,Xe);Be(this,Xe,$),N=N+D}return N});ne(this,"getInfo",()=>({active:se(this,vt),pause:se(this,st),startTime:se(this,qt),endTime:se(this,Nt),duration:se(this,tt)}));ke(this,kt,()=>{const N=this.getInfo();this.onchange(N)});ke(this,Pt,()=>{clearInterval(se(this,bt)),Be(this,bt,window.setInterval(()=>{Be(this,tt,this.getDuration()),this.onDurationChange(se(this,tt))},500))})}}Ve=new WeakMap,vt=new WeakMap,st=new WeakMap,qt=new WeakMap,Nt=new WeakMap,Xe=new WeakMap,tt=new WeakMap,bt=new WeakMap,kt=new WeakMap,Pt=new WeakMap;var l=Object.defineProperty,y=O=>{throw TypeError(O)},q=(O,N,$)=>N in O?l(O,N,{enumerable:!0,configurable:!0,writable:!0,value:$}):O[N]=$,s=(O,N,$)=>q(O,typeof N!="symbol"?N+"":N,$),P=(O,N,$)=>N.has(O)||y("Cannot "+$),n=(O,N,$)=>(P(O,N,"read from private field"),$?$.call(O):N.get(O)),a=(O,N,$)=>N.has(O)?y("Cannot add the same private member more than once"):N instanceof WeakSet?N.add(O):N.set(O,$),d,v,o;class p{constructor(N={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",($,D={})=>new Promise(async(b,k)=>{const i=D.timeout||this.options.timeout,c=D.key||n(this,d).call(this),S=D.describe||"";if(this.queue.findIndex(M=>M.key===c)!==-1)return k(`${c} is exist.`);const C={key:c,func:$,describe:S,timeout:i,resolve:b,reject:k};this.queue.unshift(C),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,$=>{const D=this.queue.findIndex(b=>b.key===$);this.queue.splice(D,1)}),a(this,o,async()=>{const $=this.queue.length;if($===0)return;const D=$-1,b=this.queue[D];this.activePromise=b;const{key:k,func:i,resolve:c,reject:S,timeout:C}=this.activePromise;C&&(this.timer=window.setTimeout(()=>{S(`pr-async-queue: ${k} is timeout.`),n(this,o).call(this)},C)),await i().then(c).catch(S).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,k),n(this,o).call(this)})}),this.options={timeout:0,...N}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;class RoomBase{constructor(N){ne(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:xt(),callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});ne(this,"sdk_service_version","1.0.8");ne(this,"sdk_session","");ne(this,"prohibitNotify",!1);ne(this,"isEarly",!1);ne(this,"isInRoom",!1);ne(this,"asyncQueue");ne(this,"roomState","ready");ne(this,"createAt",Date.now());ne(this,"cwsIns");ne(this,"peerIns");ne(this,"transceiverMap",new Map);ne(this,"sendChannel");ne(this,"receiveChannel");ne(this,"userMap",new Map);ne(this,"p2pMap",new Map);ne(this,"setLocalStreamActiveMap",new Map);ne(this,"phoneyStreams",new Map);ne(this,"recorder",new StreamRecorder);ne(this,"networkQualityTester",new NetworkQualityTester);ne(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});ne(this,"reportLogs",(N,$="未知错误")=>{const{appid:D,userId:b,earlyId:k="",logUrl:i,reportErr:c}=this.options;if(!c)return;const S="web",C=M=>({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})[M].toString();{const M=C(N),Z={origin:S,type:M,app_id:D,user_id:b,ins_id:k,desc:$},J=btoa(encodeURI(JSON.stringify(Z))),z=`${i}/upload/log?log_key=${J}`;{const Y=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),oe=new TextEncoder().encode(Y),ie=pako.deflate(oe,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:Z,url:z,size:lt(ie.byteLength)}),fetch(z,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ie})}}});ne(this,"initPhoneyStreams",(N,$=[])=>{$.length===0&&($=mediaType_keys);for(const D of $){const b=this.phoneyStreams.get(D);if(b){const k=b.getTracks();for(const i of k)i.stop()}switch(D){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(N));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(N));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});ne(this,"getPhoneyStreams",N=>this.phoneyStreams.get(N));ne(this,"getRoomInfo",()=>{const{options:N,roomState:$,createAt:D}=this;return{...N,roomState:$,createAt:D}});ne(this,"setRoomState",N=>{this.roomState=N,N==="closed"&&(this.cwsIns.state=N);const $=enum_roomState[N],D={state:N,stateStr:$};this.cwsIns.emitNotify("onRoomState",{code:200,data:D,desc:"room state is change."})});ne(this,"setOptions",async N=>{const $={...this.options,...N};this.options=$});ne(this,"stopStream",async N=>{const $=N.getTracks();for(const D of $)D.stop()});ne(this,"getMediaDevicesErrInfo",async()=>{try{const N=await navigator.mediaDevices.enumerateDevices();N.find(D=>D.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),N.find(D=>D.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(N){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",N)}return this.mediaDevicesErrInfo});ne(this,"getUserMediaKey",(N,$)=>`${N}-${$}`);ne(this,"getCallAction",async N=>{let $="";const D=k=>N.findIndex(({type:c,enabled:S=!0})=>c===k&&S)===-1?"0":"1";return $=`${D(0)}${$}`,$=`${D(1)}${$}`,$=`${D(2)}${$}`,$=`${D(3)}${$}`,parseInt($,2)});ne(this,"getCallActionMap",(N=0)=>{const D=Number(N).toString(2).padStart(4,"0").split(""),[b,k,i,c]=D;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(b)}});ne(this,"getBanBehaviorMap",(N=0)=>{const D=Number(N).toString(2).padStart(4,"0").split(""),[b,k,i,c]=D;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(k),screenSharing_audio:!!Number(b)}});ne(this,"getAverageVolume",(N,$)=>{N.getByteFrequencyData($);let D=0;for(let k=0;k<$.length;k++)D+=$[k];return Math.ceil(D/$.length)});ne(this,"getTrackNamesFormTracks",(N,$=[],D="trackName")=>{const b=[];for(const k of N){const{type:i}=k;if($.length===0||$.includes(i)){const c=k[D];c&&b.push(`${c}`)}}return b});ne(this,"usersFilter",N=>dt(N,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((b,k)=>b.id.localeCompare(k.id,"en")));this.setOptions(N),this.cwsIns=new CallsWebSocket({...N}),this.asyncQueue=new p}}var m=Object.defineProperty,G=(O,N,$)=>N in O?m(O,N,{enumerable:!0,configurable:!0,writable:!0,value:$}):O[N]=$,e=(O,N,$)=>G(O,typeof N!="symbol"?N+"":N,$);class g{constructor(N,$){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",D=>D),e(this,"stop",()=>{{const D=this.inputStream.getTracks();for(const b of D)b.stop(),this.inputStream.removeTrack(b)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(D=!0)=>{D?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",D=>{this.inputGain=D,this.inputGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async D=>{this.enhanceGain=D+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",D=>{this.bgsGain=D,this.bgsGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setBgmGain",D=>{this.bgmGain=D,this.bgmGainNode.gain.setValueAtTime(D,this.audioContext.currentTime)}),e(this,"setOutputGain",D=>{this.outputGain=D,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:D,analyserArrayData:b}=this;D.getByteFrequencyData(b);let k=0;for(let i=0;i<b.length;i++)k+=b[i];return Math.ceil(k/b.length)}),e(this,"mixAudio",(D,b="bgm")=>new Promise(async(k,i)=>{try{{const C=this.mixAudioMap.get(b);C&&C.stop()}const c=b==="bgs"?this.bgsGainNode:this.bgmGainNode,S=this.audioContext.createBufferSource();this.mixAudioMap.set(b,S),S.buffer=D,S.connect(c),S.onended=()=>{S.disconnect(c),this.mixAudioMap.delete(b),k(!0)},S.start(0)}catch(c){i(c)}})),e(this,"mixAudioStop",D=>{const b=this.mixAudioMap.get(D);b==null||b.stop()}),e(this,"changeMix",(D,b)=>{const k=D==="bgs"?this.bgsGainNode:this.bgmGainNode;b?k.connect(this.destinationNode):k.disconnect(this.destinationNode)}),$&&(this.audioContext=$),this.inputStream=N,this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:D,inputGainNode:b,enhanceGainNode:k,bgsGainNode:i,bgmGainNode:c,analyserNode:S,outputGainNode:C,destinationNode:M}=this;D.connect(b),b.connect(k),k.connect(S),i.connect(S),c.connect(S),k.connect(M),i.connect(M),c.connect(M),S.connect(C),C.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor($){super($);ke(this,St,[]);ke(this,Ge,new Map);ke(this,ze,new Map);ke(this,Qe,new Map);ke(this,nt,new Map);ke(this,ct,new Map);ne(this,"localStreamsActionMap",new Map);ke(this,Ot,new Map);ne(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));ne(this,"initMediaPhoneyStreams",($=[])=>this.initPhoneyStreams(this.audioContext,$));ne(this,"initLocalStreamsFilter",()=>{for(const $ of mediaType_keys){const D=async b=>b;se(this,Ot).set($,D)}});ne(this,"setLocalFilterStream",($,D)=>{se(this,Ot).set($,D)});ke(this,zt,()=>{se(this,ze).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),se(this,ze).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),se(this,ze).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),se(this,ze).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});ke(this,Ht,()=>{se(this,Ge).set("audioinput","default"),se(this,Ge).set("videoinput","default"),se(this,Ge).set("audiooutput","default")});ne(this,"emitNotifyUpdateUsersStreams",async $=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:$,desc:"users streams is change."})});ne(this,"initUserMediaStreamContext",async($,D,b)=>{const[k]=b.getTracks();if(!k){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:$,mediaType:D,stream:b});return}this.removeUserMediaStreamContext($,D);const i=this.getUserMediaKey($,D),{kind:c}=k;switch(c){case"audio":{const S=new MediaStream;S.addTrack(k);const C=new g(S,this.audioContext);se(this,Qe).set(i,C)}break;case"video":{const S=new VideoMediaContext(k);se(this,nt).set(i,S)}break}});ne(this,"getUserMediaStreamContext",($,D)=>{const b=this.getUserMediaKey($,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D))return se(this,Qe).get(b);if(["microphoneCamera_video","screenSharing_video"].includes(D))return se(this,nt).get(b)});ne(this,"getUserAudioMediaStreamContext",($,D)=>{const b=this.getUserMediaKey($,D);return se(this,Qe).get(b)});ne(this,"removeUserMediaStreamContext",($,D)=>{const b=this.getUserMediaKey($,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D)){const k=se(this,Qe).get(b);return k==null||k.stop(),se(this,Qe).delete(b)}if(["microphoneCamera_video","screenSharing_video"].includes(D)){const k=se(this,nt).get(b);return k==null||k.stop(),se(this,nt).get(b)}});ne(this,"getUserStream",($,D)=>{const b=this.getUserMediaStreamContext($,D);return(b==null?void 0:b.getStream())||new MediaStream});ne(this,"getUserStreams",($,D=[])=>{D.length===0&&(D=mediaType_keys);const b={};for(const k of D){const i=this.getUserStream($,k);b[k]=i}return b});ne(this,"removeUserStreams",async($,D=[])=>{D.length===0&&(D=mediaType_keys);for(const b of D)this.removeUserMediaStreamContext($,b)});ne(this,"clearUserStreams",()=>{{const $=se(this,Qe).values();for(const D of $)D.stop();Be(this,Qe,new Map)}{const $=se(this,nt).values();for(const D of $)D.stop();Be(this,nt,new Map)}});ne(this,"setMediaTrackConstraints",async($,D)=>{se(this,ze).set($,D);const b=await this.getLocalStream($);if(!b)return;const k=b.getTracks();if(k.length!==0)for(const i of k){const c=i.getConstraints(),C={...se(this,ze).get($),...c,...D};await i.applyConstraints(C)}});ne(this,"stopLocalStreams",async($=[])=>{$.length===0&&($=mediaType_keys);for(const D of $){const b=se(this,ct).get(D);b&&await this.stopStream(b),se(this,ct).delete(D)}});ne(this,"addLocalStream",($,D)=>{const b=se(this,ct).get($);b&&this.stopStream(b),se(this,ct).set($,D)});ne(this,"initLocalStream",async $=>{switch($){case"microphoneCamera_audio":{const D=se(this,Ge).get("audioinput"),b=se(this,ze).get("microphoneCamera_audio"),k=await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...b},video:!1});this.addLocalStream("microphoneCamera_audio",k)}break;case"microphoneCamera_video":{const D=se(this,Ge).get("videoinput"),b=se(this,ze).get("microphoneCamera_video"),k=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:D,...b}});this.addLocalStream("microphoneCamera_video",k)}break;case"microphoneCamera":{const D=se(this,Ge).get("audioinput"),b=se(this,Ge).get("videoinput"),k=se(this,ze).get("microphoneCamera_audio"),i=se(this,ze).get("microphoneCamera_video"),S=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...k},video:{deviceId:b,...i}})).getTracks();for(const C of S){const{kind:M}=C;if(M==="audio"){const Z=new MediaStream;Z.addTrack(C),this.addLocalStream("microphoneCamera_audio",Z)}if(M==="video"){const Z=new MediaStream;Z.addTrack(C),this.addLocalStream("microphoneCamera_video",Z)}}}break;case"screenSharing_audio":{const D=se(this,ze).get("screenSharing_audio"),k=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D})).getTracks();for(const i of k){const{kind:c}=i;if(c==="audio"){const S=new MediaStream;S.addTrack(i),this.addLocalStream("screenSharing_audio",S)}}}break;case"screenSharing_video":{const D=se(this,ze).get($),k=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...D})).getTracks();for(const i of k){const{kind:c}=i;if(c==="video"){const S=new MediaStream;S.addTrack(i),this.addLocalStream("screenSharing_video",S)}}}break;case"screenSharing":{const D=se(this,ze).get("screenSharing_audio"),b=se(this,ze).get("screenSharing_video"),i=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D,...b})).getTracks();for(const c of i){const{kind:S}=c;if(S==="audio"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_audio",C)}if(S==="video"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_video",C)}}}break}});ne(this,"getLocalStream",async $=>{const D=se(this,ct).get($),b=se(this,Ot).get($);let k=D;return D&&b&&(k=await b(D)),k});ne(this,"getLocalStreams",async($=[])=>{$.length===0&&($=mediaType_keys);const D={};for(const b of $)D[b]=await this.getLocalStream(b);return D});ke(this,Tt,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then($=>{const D=$.filter(b=>!["communications"].includes(b.deviceId));Be(this,St,D.sort((b,k)=>b.label.localeCompare(k.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",$)}),se(this,St)));ke(this,Zt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await se(this,Tt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),se(this,Tt).call(this)});ne(this,"getMediaDeviceKind",$=>se(this,Ge).get($));ne(this,"changeAudiooutput",async()=>{try{const $=se(this,Ge).get("audiooutput");await this.audioContext.setSinkId($)}catch($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",$)}});ne(this,"setDeviceKind",($,D)=>{se(this,Ge).set($,D)});ne(this,"setAudioOutputDevice",$=>this.setDeviceKind("audiooutput",$));ne(this,"getEnumerateDevices",async $=>(await se(this,Tt).call(this),se(this,St).filter(b=>b.kind===$)));ne(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));ne(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));ne(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));se(this,Zt).call(this),se(this,Ht).call(this),se(this,zt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var D;((D=this.audioContext)==null?void 0:D.state)==="suspended"&&this.audioContext.resume()})}}St=new WeakMap,Ge=new WeakMap,ze=new WeakMap,Qe=new WeakMap,nt=new WeakMap,ct=new WeakMap,Ot=new WeakMap,zt=new WeakMap,Ht=new WeakMap,Tt=new WeakMap,Zt=new WeakMap;const getIcecandidate=O=>new Promise((N,$)=>{const D=[],b=async i=>{i.candidate?D.push(i.candidate):(clearTimeout(k),O.removeEventListener("icecandidate",b),N(D))},k=window.setTimeout(()=>{O.removeEventListener("icecandidate",b),$(new Error("timeout"))},1e3);O.addEventListener("icecandidate",b)});class P2P{constructor(){ne(this,"peerIns",new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}));ne(this,"initOffer",()=>new Promise(async N=>{const $=async()=>{const c=await this.peerIns.createOffer();return await this.peerIns.setLocalDescription(c),c},D=getIcecandidate(this.peerIns),b=$(),[k,i]=await Promise.all([D,b]);N({offer:i,icecandidates:k})}));ne(this,"initAnswer",async(N,$)=>new Promise(async D=>{const b=async()=>{await this.peerIns.setRemoteDescription(N);for(const M of $)await this.peerIns.addIceCandidate(M);const C=await this.peerIns.createAnswer();return await this.peerIns.setLocalDescription(C),C},k=getIcecandidate(this.peerIns),i=b(),[c,S]=await Promise.all([k,i]);D({answer:S,icecandidates:c})}));ne(this,"setAnswer",async(N,$)=>new Promise(async D=>{await this.peerIns.setRemoteDescription(N);for(const b of $)await this.peerIns.addIceCandidate(b);D(!0)}));ne(this,"close",()=>{this.peerIns.close()});this.peerIns.addTransceiver("video",{direction:"sendrecv"})}}class RoomUsers extends RoomMedias{constructor($){super($);ne(this,"createP2P",async()=>{const $=new P2P,D=await $.initOffer();console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: res",D),this.p2pMap.set("aaa",$)});ne(this,"getMaxVolumeUser",()=>{const $=Array.from(this.userMap.values(),({id:b})=>b);if($.length===0)return;let D=[];for(const b of $){const k=this.getUserAudioMediaStreamContext(b,"microphoneCamera_audio");if(!k)continue;const i=k.getVolume();D.push({id:b,volume:i})}return D=D.sort((b,k)=>b.volume-k.volume>0?-1:1),D[0]});ne(this,"setVolume",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.setInputGain(b)});ne(this,"setEnhanceGain",async($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.setEnhanceGain(b)});ne(this,"setSpeaker",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.setOutputGain(b);const i=b===0;k==null||k.setMute(i)});ne(this,"playBgs",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);return k==null?void 0:k.mixAudio(b,"bgs")});ne(this,"setBgsGain",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.setBgsGain(b)});ne(this,"stopBgs",($,D)=>{const b=this.getUserAudioMediaStreamContext($,D);b==null||b.mixAudioStop("bgs")});ne(this,"playBgm",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);return k==null?void 0:k.mixAudio(b,"bgm")});ne(this,"setBgmGain",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.setBgmGain(b)});ne(this,"stopBgm",($,D)=>{const b=this.getUserAudioMediaStreamContext($,D);b==null||b.mixAudioStop("bgm")});ne(this,"changBgsMix",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.changeMix("bgs",b)});ne(this,"changBgmMix",($,D,b)=>{const k=this.getUserAudioMediaStreamContext($,D);k==null||k.changeMix("bgm",b)});ne(this,"getVolume",($,D)=>{const b=this.getUserAudioMediaStreamContext($,D);return b==null?void 0:b.getVolume()});ne(this,"clearUsers",()=>{this.userMap=new Map});ne(this,"removeUsers",async $=>{for(const D of $)this.userMap.delete(D),await this.removeUserStreams(D)});ne(this,"createUser",async $=>{const D=Date.now(),b={id:$,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:$===this.options.userId,isPublished:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set($,b)});ne(this,"getUser",async $=>(this.userMap.has($)||await this.createUser($),this.userMap.get($)));ne(this,"getUsers",async($=[])=>{$.length===0&&($=[...this.userMap.keys()]);const D=[];for(const b of $){const k=await this.getUser(b);D.push(k)}return D});ne(this,"getAllUserTrackMids",async()=>{const $=await this.getUsers(),D=[];for(const b of $){const{tracks:k=[]}=b;for(const i of k)D.push(i.mid)}return D});ne(this,"getUserTrackByTrackName",async $=>{const D=await this.getUsers(),b=[];for(const k of D){const{tracks:i=[]}=k;for(const c of i){const{trackName:S}=c;$.includes(S)&&b.push(c)}}return b});ne(this,"getUserTrackFromMid",async $=>{const D=await this.getUsers();let b;for(const k of D){const{tracks:i=[]}=k;for(const c of i)if(c.mid===$){b=c;break}}return b});ne(this,"checkUserInRoom",$=>this.userMap.has($));ne(this,"getUsersId",async()=>[...this.userMap.keys()]);ne(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));ne(this,"updateIsPublished",async($,D=!1)=>{const b=await this.getUser($);b.isPublished=D});ne(this,"setUserUpdateStreams",async($,D,b=!0)=>{const k=await this.getUser($),i={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};i[D]=b,k.updateStreams=i});ne(this,"updateUserChannels",async($,D=[],b)=>{const k=await this.getUser($);b&&(D=[...k.channels,...D]),k.channels=D});ne(this,"updateUsertracks",async($,D=[],b)=>{const k=await this.getUser($);b&&(D=[...k.tracks,...D]),D=D.filter(({mid:S=""})=>S!==""),D=pt(D,["type"]),D=D.sort((S,C)=>S.type-C.type<0?-1:1);for(const S of D)S.userId=$,S.mediaType=mediaType_keys[S.type],S.enabled===void 0&&(S.enabled=!0);k.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const i=dt(k.tracks,["mediaType","enabled","mid","msid","trackName","key"]),c=dt(D,["mediaType","enabled","mid","msid","trackName","key"]);for(const S of mediaType_keys){const C=c.find(J=>J.mediaType===S),M=i.find(J=>J.mediaType===S),Z=JSON.stringify(C)!==JSON.stringify(M);k.updateStreams[S]=Z}k.tracks=D});ne(this,"updateUserCallAction",async($,D=0)=>{const b=await this.getUser($);b.callAction=D,b.callActionStr=D.toString(2).padStart(4,"0"),b.callActionMap=this.getCallActionMap(D)});ne(this,"updateUserBehaviors",async($,D=0)=>{const b=await this.getUser($);b.banBehavior=D,b.banBehaviorStr=D.toString(2).padStart(4,"0"),b.banBehaviorMap=this.getBanBehaviorMap(D)});ne(this,"updateUserNetwork",async($,D={egress:5,ingress:5})=>{const b=await this.getUser($);b.network=D});ne(this,"updateUserPermissions",async($,D)=>{if(D){const b=await this.getUser($);b.permissions=D}});ne(this,"updateUserBase",async $=>{const D=await this.getUser($);D.isSelf=$===this.options.userId,D.updateAt=Date.now()});ne(this,"updateUsers",async $=>{for(const D of $){const{id:b,tracks:k,callAction:i,permissions:c,isPublished:S}=D;await this.updateUserBase(b),await this.updateIsPublished(b,S),await this.updateUserPermissions(b,c),await this.updateUsertracks(b,k,!0),await this.updateUserCallAction(b,i),await this.updateUserNetwork(b)}});ne(this,"emitNotifyUpdateUser",async $=>{const D=await this.getUsers([$]),[b]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:b,desc:"user info is change."})});ne(this,"emitNotifyUpdateUsers",async()=>{const $=await this.getUsers(),D=this.usersFilter($);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor($){super($);ne(this,"getPeerStatsTimer",0);ne(this,"reports",[]);ne(this,"candidates",[]);ke(this,Ut,[]);ke(this,It,0);ne(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});ne(this,"initPeer",()=>{var $;clearTimeout(se(this,It)),this.transceiverMap=new Map,($=this.peerIns)==null||$.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),se(this,Jt).call(this),se(this,Gt).call(this),this.initMediaPhoneyStreams()});ne(this,"initSendChannel",($="",D)=>{const b=this.peerIns.createDataChannel($,{negotiated:!0,id:D});b.addEventListener("open",async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onopen",k),setInterval(()=>{const i=new Date().getTime();b.send(`Hi you! on: ${E(i)}`)},1e3)}),b.addEventListener("close",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: close",k)}),b.addEventListener("message",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onmessage",k)}),this.sendChannel=b,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initSendChannel",{label:$,id:D,channel:b})});ne(this,"initReceiveChannel",($="",D)=>{const b=this.peerIns.createDataChannel($,{negotiated:!0,id:D});b.addEventListener("open",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onopen",k)}),b.addEventListener("close",k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: close",k)}),b.addEventListener("message",async k=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onmessage",k)}),this.receiveChannel=b,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initReceiveChannel",{label:$,id:D,channel:b}),this.receiveChannel.send("hello")});ne(this,"replaceSenderStream",async($=[],D)=>{const{userId:b}=this.options;$.length===0&&($=mediaType_keys);for(const k of $){const i=this.transceiverMap.get(k);let c;if(i){const{sender:S}=i;D?c=this.getUserStream(b,k):c=this.getPhoneyStreams(k);const[C]=c.getTracks();C&&await S.replaceTrack(C)}}});ne(this,"getSenderTracks",async($=[])=>{const D=[];for(const b of $){const k=this.transceiverMap.get(b);if(!k)continue;const{mid:i,sender:c}=k,{track:S}=c;if(!S)continue;const{id:C,enabled:M}=S,Z=mediaType_keys.findIndex(Y=>Y===b),J=xt(),z={type:Z,enabled:M,trackName:`web-${Z}-${C}`,location:"local",mid:i,key:J};D.push(z)}return D});ne(this,"addSenders",async($=[])=>{$.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const D=[];for(const b of $){if(this.transceiverMap.get(b))continue;const i=this.getPhoneyStreams(b),[c]=i.getTracks(),S=this.peerIns.addTransceiver(c,{direction:"sendonly"});this.transceiverMap.set(b,S),D.push(b)}if($.length===0||D.length!==0){const b=await this.peerIns.createOffer();if(this.options.debug){const k=libExports$1.parse(b.sdp),i=dt(k.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:k,description:b})}await this.peerIns.setLocalDescription(b)}return D});ne(this,"removeSenders",async($=[])=>{$.length===0&&($=mediaType_keys);for(const D of $)this.transceiverMap.has(D)&&this.transceiverMap.delete(D)});ne(this,"onSubscribeUserTracks",$=>{let D=0;return new Promise(async b=>{const k=[];for(const i of $){const{tracks:c=[]}=i;for(const S of c){const{trackName:C,mid:M}=S,[Z]=await this.getUserTrackByTrackName([C]);k.push({...Z,mid:M})}}{let i=[];const c=async()=>{clearTimeout(D);const C=new Map;for(const Z of i){const{userId:J,mediaType:z}=Z;if(!J||!z)continue;C.has(J)||C.set(J,{userId:J,tracks:[],updateStreams:{}});const re=C.get(J);re.tracks.push(Z),re.updateStreams[z]=!0}const M=[...C.values()];for(const Z of M){const{userId:J,tracks:z}=Z;await this.updateUsertracks(J,z,!0)}await this.emitNotifyUpdateUsersStreams(M),this.peerIns.removeEventListener("track",S);{const Z=Array.from(k,Y=>Y.trackName),J=Array.from(i,Y=>Y.trackName),z=Z.filter(Y=>!J.includes(Y));b({target:Z,success:J,fail:z})}},S=async C=>{const{streams:M,transceiver:Z}=C,[J]=M,{mid:z,receiver:Y}=Z,{track:re}=Y,{id:oe}=re,ie=k.find(Q=>Q.mid===`${z}`);if(!ie)return;const{userId:de,mediaType:ye}=ie;if(!(!de||!ye)){{const Q={...ie,mid:z,msid:oe,key:xt()};i.push(Q)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${i.length}/${k.length}`,{mediaType:ye,mid:z,userTrack:ie,e:C});{const Q=new Audio;if(Q.srcObject=J,await this.initUserMediaStreamContext(de,ye,J),ye==="microphoneCamera_audio"||ye==="screenSharing_audio"){const ae=this.getUserAudioMediaStreamContext(de,ye);ae==null||ae.setMute(!1)}}k.length===i.length&&c()}};this.peerIns.addEventListener("track",S),D=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${i.length}/${k.length})`),c()},5*1e3)}})});ke(this,Jt,()=>{const $=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=async()=>{const D=this.peerIns.iceConnectionState;switch(clearTimeout(se(this,It)),D){case"connected":{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${D}`),this.setRoomState("connected");for(const b of se(this,Ut))await b()}break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${D}`),Be(this,It,window.setTimeout($,30*1e3));break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${D}`),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:${D}`),$();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${D}`);break}}});ne(this,"iceConnected",()=>new Promise($=>{if(this.peerIns.iceConnectionState==="connected")return $(!0);se(this,Ut).push($)}));ne(this,"closeUserTracks",async($,D=[],b=!1)=>{const k=[];for(const C of D){const{trackName:M,msid:Z}=C;k.push(M),Z&&k.push(Z)}const i=C=>k.includes(C),c=this.peerIns.getTransceivers();for(const C of c){const{mid:M,sender:Z,receiver:J}=C;Z.track&&i(Z.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${M} is stop.`,C)),J.track&&i(J.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${M} is stop.`,C))}const S=await this.getUser($);if(S){for(const C of S.tracks){const{trackName:M,msid:Z,userId:J,mediaType:z}=C;!J||!z||!i(M)||(this.removeUserMediaStreamContext(J,z),Z&&delete C.msid)}if(b){const C=S.tracks.filter(({trackName:M})=>!i(M));await this.updateUsertracks($,C,!1)}}});ne(this,"createOffer",async()=>{const $=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse($.sdp),b=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:b,sdpJson:D,description:$})}await this.peerIns.setLocalDescription($)});ne(this,"createAnswer",async()=>{const $=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports$1.parse($.sdp),b=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:b,sdpJson:D,description:$})}await this.peerIns.setLocalDescription($)});ne(this,"getSdp",()=>{var $;return($=this.peerIns.localDescription)==null?void 0:$.sdp});ne(this,"setRemoteDescription",async $=>{if(this.options.debug){const D=libExports$1.parse($.sdp),b=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:b,sdpJson:D,description:$})}return await this.peerIns.setRemoteDescription($),$});ne(this,"setCallStrategy",async($,D=[])=>{D.length===0&&(D=mediaType_keys);let b="balanced";switch($){case"qualityPriority":b="maintain-resolution";break;case"fluencyPriority":b="maintain-framerate";break;case"balancedDowngrade":b="balanced";break}const k=await this.getSelfInfo(),i=Array.from(k.tracks,({trackName:S})=>S),c=this.peerIns.getSenders();for(const S of c){const{track:C}=S;if(!C||!i.includes(C.id))continue;const M=S.getParameters();S.setParameters({...M,degradationPreference:b})}});ne(this,"setRTCRtpSenderParameters",$=>{try{const D=this.peerIns.getSenders();for(const b of D){const k=b.getParameters();b.setParameters({...k,...$})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}});ne(this,"getReportsByMid",async($=[])=>$.length===0?this.reports:this.reports.filter(D=>$.includes(D.mid)));ne(this,"getRoomNetwork",()=>this.peerNetwork);ne(this,"getPeerNetwork",()=>this.peerNetwork);ke(this,Vt,async()=>{try{const $=await this.peerIns.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],k=[...$.values()].filter(ae=>D.includes(ae.type));let i=0,c=0,S=0,C=0,M=0,Z=0,J=[],z=[];for(const ae of this.reports){const{packetsSent:he,packetsLost:ce}=ae;he&&(S+=he),ce&&(C+=ce)}this.reports=k;for(const ae of this.reports){const{bytesSent:he,bytesReceived:ce,packetsSent:fe,packetsLost:me,roundTripTime:ee,jitter:le}=ae;he&&(c=he),ce&&(i=ce),fe&&(M+=fe),me&&(Z+=me),ee&&J.push((ee*100).toFixed(2)),le&&z.push(le.toFixed(2))}z.sort().reverse(),J.sort().reverse();const Y=M-S,re=Z-C,oe=Y===0?"0.00":(re/Y).toFixed(2),[ie="0"]=J,[de="0"]=z,ye={outboundBytes:c,inboundBytes:i,lostRate:oe,roundTripTime:ie,jitter:de};this.peerNetwork=ye;const Q=(ae,he,ce)=>{const fe=Number(ae),me=Number(he),ee=Number(ce);let le="0";return fe<.03&&me<100&&ee<.05?le="5":fe<.06&&me<160&&ee<.1?le="4":fe<.1&&me<250&&ee<.15?le="3":fe<.15&&me<400&&ee<.2?le="2":le="1",Number(le)};{const ae=Q(oe,ie,de),he=await this.getSelfInfo(),{network:ce}=he,fe={egress:ae,ingress:ae};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,fe),JSON.stringify(ce)!==JSON.stringify(fe)){this.emitNotifyUpdateUsers();const{userId:le,roomId:ve}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...fe,userId:le,roomId:ve}},!1)}},3*1e3)}}catch($){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",$)}});ke(this,Gt,()=>{const $=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||se(this,Vt).call(this)};this.getPeerStatsTimer=window.setInterval($,1*1e3)});ne(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer));this.initPeer()}}Ut=new WeakMap,It=new WeakMap,Jt=new WeakMap,Vt=new WeakMap,Gt=new WeakMap;class RoomCalls extends RoomPeer{constructor($){super($);ke(this,Et,0);ke(this,Rt,[]);ke(this,_t,()=>{});ne(this,"setLocalStream",($,D)=>new Promise(async(b,k)=>{try{typeof $=="string"&&($=[$]);for(const c of $)this.localStreamsActionMap.set(c,D);if(D){if($.includes("microphoneCamera_audio")&&$.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):$.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):$.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):$.includes("screenSharing_audio")&&$.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):$.includes("screenSharing_audio")&&!$.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):$.includes("screenSharing_video")&&!$.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),$.includes("screenSharing_audio")){const c=await this.getLocalStream("screenSharing_audio");if(c){const S=c.getTracks();for(const C of S)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if($.includes("screenSharing_video")){const c=await this.getLocalStream("screenSharing_video");if(c){const S=c.getTracks();for(const C of S)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams($);const i=await this.getLocalStreams($);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),b(i)}catch(i){k(i)}}));ne(this,"setMediaDeviceKind",($,D)=>new Promise(async(b,k)=>{this.setDeviceKind($,D);const i=await this.getSelfInfo(),{id:c,tracks:S=[],callActionMap:C}=i,M=[],Z=async J=>{const z=this.localStreamsActionMap.get(J),Y=S.find(oe=>oe.mediaType===J),re=C[J];if(z){M.push(J),await this.stopLocalStreams([J]);try{await this.initLocalStream(J)}catch(oe){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",oe),await this.inactiveTracks([J],!1),k(oe)}}if(Y){const oe=await this.getLocalStream(J);oe&&(await this.initUserMediaStreamContext(c,J,oe),re&&await this.replaceSenderStream([J],!0))}{const oe=await this.getLocalStreams(M);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:oe,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),b(!0)}};$==="audioinput"&&await Z("microphoneCamera_audio"),$==="videoinput"&&await Z("microphoneCamera_video"),$==="audiooutput"&&(await this.changeAudiooutput(),b(!0))}));ne(this,"changeScreenSharing",async $=>{const D=await this.getSelfInfo(),{tracks:b=[],callActionMap:k}=D;try{await this.setLocalStream($,!0);for(const i of $)b.find(S=>S.mediaType===i&&k[i])&&await this.replaceSenderStream([i],!0)}catch(i){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",i)}});ne(this,"earlyConnect",($=[])=>{this.isEarly=!0;const D=async()=>new Promise(async(b,k)=>{try{await se(this,wt).call(this).then(async()=>{await se(this,Dt).call(this),$.length===0&&($=["microphoneCamera_audio","microphoneCamera_video"]),await se(this,Mt).call(this,$),b(!0)})}catch(i){k(i)}});return this.asyncQueue.add(D,{describe:"earlyConnect"})});ne(this,"joinRoom",async $=>(this.isInRoom=!0,this.setOptions($),await se(this,wt).call(this),new Promise(async(D,b)=>{Be(this,_t,async()=>{try{this.clearUsers();const{roomId:k,userId:i,callType:c,sdkToken:S}=this.options;await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:c,roomId:k,user:{id:i,tracks:[],callAction:0},token:S},version:2}).then(async C=>{const{code:M=0,desc:Z="服务器繁忙",data:J}=C;if(M!==200)throw new Error(Z);const{roomId:z="",roomUsers:Y=[]}=J;if(z!==k)return b("加入的房间不匹配");this.initHeartbeat(),this.isEarly===!1&&await se(this,Dt).call(this),await this.updateUsers(Y);const re=[];for(const ie of Y){const{id:de,channelCache:ye}=ie,{channels:Q=[]}=ye;await this.updateUserBehaviors(de,ie.behavior),await this.updateUserChannels(de,Q,!1),Q.length!==0&&re.push({userId:de,channels:Q})}await this.subChannel(re),await this.emitNotifyUpdateUsers();const oe=await this.getUsers();D(oe)})}catch(k){b(k)}}),se(this,_t).call(this)})));ne(this,"quitRoom",()=>new Promise(async $=>{const{roomId:D,userId:b}=this.options,k={roomId:D,user:{id:b}};try{this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),clearInterval(se(this,Et)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),await this.cwsIns.sendMessage({event:"quitRoom",data:k}),$(!0)}));ne(this,"quitRoomEx",()=>new Promise(async $=>{const{roomId:D,userId:b}=this.options,k={roomId:D,user:{id:b}};try{this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),this.stopHeartbeat(),this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe().catch(()=>{this.reconstruct()}),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:k}),$(!0)}));ne(this,"syncRoomInfo",()=>new Promise(async($,D)=>{try{const{userId:b}=this.options,k=await this.getUser(b),{id:i=b,callAction:c=0}=k;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:c}}}).then(async S=>{const{code:C=0,desc:M,data:Z={}}=S;if(C!==200)throw new Error(M);const{isActive:J=!1,users:z=[]}=Z;if(J===!1)throw new Error("Do not stay in this room.");if(z.find(re=>re.id===this.options.userId)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(z),await this.updateUsertracks(k.id,k.tracks,!1);{const re=await this.getUsers();$(re)}})}catch(b){D(b)}}));ne(this,"checkInRoom",()=>new Promise(async $=>{const{userId:D}=this.options,b=await this.getUser(D),{id:k=D,callAction:i=0}=b;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:k,callAction:i}}}).then(async c=>{var J;const{code:S=0,desc:C}=c;if(S!==200)throw new Error(C);const M=c.data.users;return(J=c.data)!=null&&J.isActive||M.find(z=>z.id===this.options.userId)?$(!0):$(!1)}).catch(()=>$(!1))}));ne(this,"publish",$=>{const D=()=>new Promise(async(b,k)=>{try{{const J=await this.getSelfInfo(),{banBehaviorMap:z}=J;let Y=!0;for(const re of $)if(z[re]){Y=!1;break}if(Y===!1)return k("publish is error: prohibited by administrator.")}try{await this.setLocalStream($,!0)}catch(J){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",J)}const i=await this.getSelfInfo(),c=[];for(const J of $){{const z=this.getPhoneyStreams(J);await this.initUserMediaStreamContext(i.id,J,z)}{const z=await this.getLocalStream(J);z?await this.initUserMediaStreamContext(i.id,J,z):c.push(J)}}const S=$.filter(J=>!c.includes(J)||["microphoneCamera_audio","microphoneCamera_video"].includes(J));await this.replaceSenderStream($,!1),await se(this,Mt).call(this,S);const C=await this.getSenderTracks(S),M=[...i.tracks,...C];await this.updateUsertracks(i.id,M,!0),c.length!==0&&await this.inactiveTracks(c,!1),S.length!==0&&await this.replaceSenderStream(S,!0);const Z=await this.getCallAction(M);await se(this,Ct).call(this,Z),await new Promise(J=>setTimeout(()=>J(!0),230)),se(this,Wt).call(this,$);{await this.emitNotifyUpdateUsers();const J=await this.getSelfInfo();b(J)}}catch(i){this.reportLogs("publish_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"publish"})});ne(this,"stopPublish",($=[])=>{const D=()=>new Promise(async(b,k)=>{try{const i=await this.getSelfInfo();$.length===0&&($=mediaType_keys);const c=i.tracks.filter(({mediaType:C})=>C&&$.includes(C)),S=async()=>{const C=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),b(C)};if(c.length===0)return S();await this.replaceSenderStream($,!0),await this.closeUserTracks(i.id,c,!0),await this.removeSenders($);{const C=await this.getCallAction(i.tracks);await se(this,Ct).call(this,C)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{session:this.sdk_session,roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:M=0,desc:Z,sn:J="",data:z={}}=C;if(await se(this,ut).call(this,J),M!==200)throw new Error(Z);const{remoteSdp:Y}=z;await this.setRemoteDescription({type:"answer",sdp:Y}),S()})}catch(i){this.reportLogs("close_track_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"stopPublish"})});ne(this,"subscribe",($=[],D=3)=>{const b=()=>new Promise(async(k,i)=>{try{await this.iceConnected();const c=await this.getUsers();let S=[];for(const J of c){const{isSelf:z,tracks:Y=[]}=J;if(!z){const re=Y.filter(({trackName:oe,mid:ie=""})=>ie!==""&&($.includes(oe)||$.length===0));re.length!==0&&S.push({...J,tracks:re})}}const C=async(J={})=>{const z=Array.from(S,({id:re})=>re),Y=await this.getUsers(z);await this.emitNotifyUpdateUsers(),k({users:Y,detail:J})};if(S.length===0)return C();const M=[];for(const J of S){const{id:z,tracks:Y}=J,re=dt(Y,["type","trackName"]),oe={id:z,tracks:re};M.push(oe)}const Z=async()=>{D--,await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:M}}).then(async J=>{const{code:z=0,desc:Y,sn:re="",data:oe={}}=J;if(await se(this,ut).call(this,re),z===2017&&Y.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),z!==200){if(D>=0)return await new Promise(ye=>setTimeout(()=>ye(!0),500)),await Z();throw new Error(Y)}const{remoteSdp:ie,users:de=[]}=oe;this.onSubscribeUserTracks(de).then(async ye=>{await this.renegotiate().then(()=>C(ye))}).catch(ye=>{throw new Error(ye)}),await this.setRemoteDescription({type:"offer",sdp:ie})})};await Z()}catch(c){this.reportLogs("subscribe_error",c.message||c),i(c)}});return this.asyncQueue.add(b,{describe:"subscribe"})});ne(this,"renegotiate",()=>new Promise(async($,D)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(async b=>{const{code:k=0,desc:i,sn:c=""}=b;if(await se(this,ut).call(this,c),k!==200)throw new Error(i);$(b)})}catch(b){D(b)}}));ne(this,"stopSubscribe",($=[])=>{const D=()=>new Promise(async(b,k)=>{try{const i=await this.getUsers(),c=[];for(const C of i){const{tracks:M=[]}=C;for(const Z of M){const{type:J,mid:z,trackName:Y,mediaType:re,msid:oe}=Z;if(!(!re||!oe)&&($.length===0||$.includes(Y))){const ie={type:J,mid:z,trackName:oe};c.push(ie),await this.closeUserTracks(C.id,[Z])}}}const S=async()=>{await this.emitNotifyUpdateUsers(),b(!0)};if(c.length===0)return S();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:M=0,desc:Z,sn:J="",data:z={}}=C;if(M!==200)throw new Error(Z);await se(this,ut).call(this,J);const{remoteSdp:Y}=z;await this.setRemoteDescription({type:"answer",sdp:Y})}),S()}catch(i){this.reportLogs("close_track_error",i.message||i),k(i)}});return this.asyncQueue.add(D,{describe:"stopSubscribe"})});ne(this,"inactiveTracks",async($,D)=>new Promise(async b=>{const k=await this.getSelfInfo();if(!k||!k.id)return b(!0);const{tracks:i=[]}=k,c=[...i];for(let C of c){const{mediaType:M}=C;if(M&&$.includes(M)){C.enabled=D;const Z=await this.getLocalStream(M);if(!Z)continue;const J=Z.getTracks();for(const z of J)z.enabled=D}}await this.replaceSenderStream($,D);const S=await this.getCallAction(c);await se(this,Ct).call(this,S),await this.emitNotifyUpdateUsers(),b(!0)}));ne(this,"setBanBehaviors",$=>new Promise(async(D,b)=>{try{const{roomId:k}=this.options,i=[];for(const c of $){const{id:S,banBehaviors:C}=c,M=Object.keys(C);if(M.length===0)continue;const Z=[];for(const z of M){const Y=mediaType_keys.findIndex(ie=>ie===z),re=C[z],oe={type:Y,behavior:re};Z.push(oe)}const J={id:S,behaviors:Z};i.push(J)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:k,users:i}}).then(async c=>{const{code:S=0,desc:C}=c;if(S!==200)return b(C);D(c)})}catch(k){b(k)}}));ne(this,"pubChannel",()=>new Promise(async($,D)=>{const k=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:k}}).then(async i=>{const{code:c=0,data:S,desc:C}=i;if(c!==200)throw new Error(C);const{channels:M=[]}=S;for(const Z of M){const{channels:J=[]}=Z;for(const z of J){const{dataChannelName:Y,id:re}=z;this.initSendChannel(Y,re)}}$(!0)}).catch(i=>{D(i)})}));ne(this,"subChannel",($=[])=>new Promise(async D=>{if($.length===0)return D(!0);await this.cwsIns.sendMessage({event:"subChannel",data:{channels:$}}).then(async b=>{const{code:k=0,data:i,desc:c}=b;if(k!==200)throw new Error(c);const{channels:S=[]}=i;for(const C of S){const{channels:M=[]}=C;for(const Z of M){const{dataChannelName:J,id:z}=Z;this.initReceiveChannel(J,z)}}})}));ne(this,"debugger",()=>new Promise(async($,D)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async b=>{if(b.code!==200)return D(b.desc);$(!0)}).catch(b=>{D(b)})}));ne(this,"shutdown",()=>new Promise(async($,D)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async b=>{if(b.code!==200)return D(b.desc);$(!0)}).catch(b=>{D(b)})}));ne(this,"reconstruct",async()=>{if(this.asyncQueue.clear(),this.setRoomState("ready"),this.asyncQueue.clear(),this.initPeer(),this.isEarly&&this.earlyConnect(),this.isInRoom===!1)return;this.isInRoom&&(this.isEarly===!1&&await se(this,wt).call(this).then(async()=>{await se(this,Dt).call(this)}),se(this,_t)&&await se(this,_t).call(this));const $=[],D=[],b=await this.getUsers();for(const k of b){const{isSelf:i,callActionMap:c,tracks:S=[]}=k;if(i)for(const C of mediaType_keys)c[C]&&$.push(C);for(const C of S)C.msid&&D.push(C.trackName)}await this.syncRoomInfo().then(async()=>{await this.publish($),await this.subscribe(D)}).catch(()=>{this.setRoomState("closed")})});ne(this,"initHeartbeat",()=>{this.stopHeartbeat();const $=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),D=this.isInRoom?10*1e3:30*1e3;Be(this,Et,window.setInterval($,D)),$()});ne(this,"stopHeartbeat",()=>{clearInterval(se(this,Et))});ke(this,Wt,async $=>new Promise(async(D,b)=>{try{const{roomId:k}=this.options;if(!k)return;const{id:i,tracks:c=[]}=await this.getSelfInfo(),S=c.filter(C=>C.mediaType&&$.includes(C.mediaType));if(S.length===0)return;await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:k,user:{id:i,tracks:S}}}),D(!0)}catch(k){b(k)}}));ke(this,ut,$=>new Promise(D=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:$}},!1),D(!0)}));ke(this,Ct,async $=>new Promise(async(D,b)=>{const{roomId:k,userId:i}=this.options,c={roomId:k,user:{id:i,callAction:$}};await this.cwsIns.sendMessage({event:"updateCall",data:c}).then(async S=>{const{code:C=0}=S;if(C!==200)return b(S);await this.updateUserCallAction(i,$),D($)}).catch(S=>b(S))}));ne(this,"setSession",()=>{const{appid:$,roomId:D,userId:b}=this.options;if(!$)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const k={c:$,r:D,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly?k.i=this.options.earlyId:k.b=b;const i=btoa(encodeURI(JSON.stringify(k)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSession",k);const c=`${this.options.url}?s=${i}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:c})});ke(this,wt,()=>new Promise(async($,D)=>{try{switch(this.cwsIns.state){case"connected":this.cwsIns.state==="connected"&&$(!0);break;case"connecting":se(this,Rt).push($);break;case"closed":{se(this,Rt).push($),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat();for(const b of se(this,Rt))await b()}break}}catch(b){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",b),this.reportLogs("ws_c_timeout",b.message||b),D(b)}}));ke(this,Dt,async()=>new Promise(async($,D)=>{try{await se(this,wt).call(this),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async b=>{const{code:k=0,desc:i,data:c}=b;if(k!==200)throw new Error(i);const{remoteSdp:S,session:C=""}=c;if(this.sdk_session=C,this.options.debug){const M=libExports$1.parse(S),Z=dt(M.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:Z,sdpJson:M})}await this.setRemoteDescription({type:"answer",sdp:S}),await this.iceConnected().then(()=>{$(!0)})})}catch(b){D(b)}}));ke(this,Mt,async $=>new Promise(async(D,b)=>{try{await this.iceConnected();const k=await this.addSenders($),i=await this.getSenderTracks(k);if(i.length===0)return D(!0);await this.cwsIns.sendMessage({event:"publish",data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}).then(async c=>{const{code:S=0,desc:C,sn:M="",data:Z={}}=c;if(await se(this,ut).call(this,M),S!==200)throw new Error(C);const{remoteSdp:J}=Z;await this.setRemoteDescription({type:"answer",sdp:J}),D(!0)})}catch(k){this.reportLogs("publish_error",k.message||k),await this.removeSenders($),b(k)}}))}}Et=new WeakMap,Rt=new WeakMap,_t=new WeakMap,Wt=new WeakMap,ut=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Dt=new WeakMap,Mt=new WeakMap;class Room extends RoomCalls{constructor(N){super(N)}}class QuickVO extends Room{constructor($){super($);ke(this,gt,new Map);ke(this,Kt,()=>{{const $=async D=>{const{state:b}=D.data;if(b==="closed"){const{roomId:k,userId:i}=this.options,c={roomId:k,user:{id:i}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:c}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:$},!0)}{const $=async D=>{const{qualities:b=[]}=D.data,[k]=b;if(!(k&&k.userId===this.options.userId&&b.length===1)){for(const i of b){const{userId:c,egress:S,ingress:C}=i;this.checkUserInRoom(c)&&await this.updateUserNetwork(c,{egress:S,ingress:C})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:$},!0)}{const $=async D=>{const b=D.data.user;await this.removeUsers([b.id]),await this.updateUsers([b]),await this.updateUsertracks(b.id,b.track,!1),await this.updateUserBehaviors(b.id,b.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:$},!0)}{const $=async D=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:$},!0)}{const $=async D=>{const{user:b}=D.data,{id:k,tracks:i=[],callAction:c=0}=b,S=()=>new Promise(async C=>{await this.updateUserCallAction(k,c),await this.updateUserPermissions(k,3),await this.updateUsertracks(k,i,!0),C(!0)});this.asyncQueue.add(S,{describe:"onPublish"}).then(async()=>{if(this.options.newPublishAutoSubscribe){const C=this.getTrackNamesFormTracks(i);await this.subscribe(C)}else await this.emitNotifyUpdateUsers()})};this.cwsIns.addNotify({event:"onPublish",callback:$},!0)}{const $=async D=>{const b=[D.data];this.subChannel(b)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:$},!0)}{const $=async D=>{const{id:b,tracks:k}=D.data.user;b!==this.options.userId&&(await this.closeUserTracks(b,k,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:$},!0)}{const $=async D=>{const{id:b,callAction:k}=D.data.user;this.checkUserInRoom(b)&&(await this.updateUserCallAction(b,k),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:$},!0)}{const $=async D=>{const{user:b}=D.data,{id:k,permissions:i=1}=b;i===1?await this.removeUsers([k]):i===3&&await this.updateUsers([b]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:$},!0)}{const $=async D=>{const{users:b}=D.data;for(const k of b){const{id:i,behavior:c}=k;await this.updateUserBehaviors(i,c)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:$},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async $=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ne(this,"addNotify",$=>this.cwsIns.addNotify($));ke(this,Yt,()=>{this.cwsIns.prws.checkReconnect=async $=>$.code===1e3?(this.setRoomState("closed"),!1):$.code===4001?(this.setRoomState("closed"),!1):$.code===4002?(this.setRoomState("closed"),!1):$.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),$.code===4010||await new Promise(D=>setTimeout(()=>D(!0),5*1e3)),!0),this.cwsIns.prws.onReconnectSuccess=async $=>{this.reconstruct()},this.cwsIns.prws.onReconnectStop=async $=>{this.setRoomState("closed")}});ne(this,"addRequestAnimationFrame",async($,D)=>{{const k=se(this,gt).get($);k&&cancelAnimationFrame(k)}const b=(k=Date.now())=>{D(k);const i=requestAnimationFrame(b);se(this,gt).set($,i)};b()});ne(this,"clearRequestAnimationFrame",async($=[])=>{$.length===0&&($=[...se(this,gt).keys()]);const D=[];for(const b of $){const k=se(this,gt).get(b);k&&(cancelAnimationFrame(k),D.push(k))}return D});ne(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise($=>setTimeout(()=>$(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.clearEvents()});se(this,Yt).call(this),se(this,Kt).call(this)}}gt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});