quickvo-sdk-js 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22401 -21946
- package/dist/index.umd.cjs +11 -11
- package/dist/protos/compiled.d.ts +5009 -5009
- package/dist/room/RoomBase.d.ts +2 -2
- package/dist/room/RoomCalls.d.ts +5 -12
- package/dist/room/RoomPeer.d.ts +4 -0
- package/dist/types.d.ts +0 -1
- package/package.json +49 -49
package/dist/index.umd.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
(function(bt,mt){typeof exports=="object"&&typeof module<"u"?mt(exports):typeof define=="function"&&define.amd?define(["exports"],mt):(bt=typeof globalThis<"u"?globalThis:bt||self,mt(bt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var nr=Object.defineProperty;var er=bt=>{throw TypeError(bt)};var rr=(bt,mt,qt)=>mt in bt?nr(bt,mt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):bt[mt]=qt;var Ee=(bt,mt,qt)=>rr(bt,typeof mt!="symbol"?mt+"":mt,qt),tr=(bt,mt,qt)=>mt.has(bt)||er("Cannot "+qt);var De=(bt,mt,qt)=>(tr(bt,mt,"read from private field"),qt?qt.call(bt):mt.get(bt)),at=(bt,mt,qt)=>mt.has(bt)?er("Cannot add the same private member more than once"):mt instanceof WeakSet?mt.add(bt):mt.set(bt,qt),Ct=(bt,mt,qt,Jt)=>(tr(bt,mt,"write to private field"),Jt?Jt.call(bt,qt):mt.set(bt,qt),qt);var bt,mt,qt,Jt,Yt,Dn,Bn,Nn,En,Mn,qn,Pn,Xt,mn,hn,In,xn,sn,ln,yn,vn,Rn,wn,en,Ht,cn,un,pn,kn,Un,Ln,Sn,Fn,Hn,jn,zn,Tn,Jn,On,Cn,An,bn,Wn,Vn,Zn,Kn;const lt=(N,Z={})=>{const q={unit:"B",splitStr:" ",...Z};let{unit:J,splitStr:I}=q;const D=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],a=D.findIndex(z=>z===J),O=D.slice(a+1,D.length);let F=N;for(const z of O)if(J=z,F=F/1024,F<1024)break;return`${F.toFixed(2)}${I}${J}`},P=(N,Z=[])=>{const q={...N},J=Object.keys(q);for(const I of J)Z.findIndex(D=>String(D)===I)===-1&&delete q[I];return q},pt=(N,Z=[],q=!0)=>{const J=new Map;for(const D of N){const a=[];for(const F of Z)a.push(D[F]);const O=`map-${a.join("-")}`;if(!J.has(O)){J.set(O,D);continue}q&&J.set(O,D)}const I=J.entries();return Array.from(I,([D,a])=>a)},dt=(N,Z=[])=>{const q=[];for(const J of N){const I=P(J,Z);q.push(I)}return q},ht=(N,Z="value",q="label")=>{const J=[],I=Object.entries(N);for(const[D,a]of I){const O={[q]:a,[Z]:D};J.push(O)}return J},v$1=(N=0,Z=1)=>{const q=Math.max(0,N),J=Math.max(1,Z),I=Math.random()*(J-q+1)+q;return parseInt(`${I}`,10)},xt=(N=16,Z=16)=>{const q="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),J=Math.min(q.length,Z),I=Date.now().toString(J),D=I.split(""),a=Math.max(4,N-I.length);for(let O=0;O<a;O++){const F=v$1(0,J-1),z=q[F];D.push(z)}return D.join("").toUpperCase()},W=(N,Z)=>{try{let q=Number(N);if(isNaN(q)){const J=new Date(`${N}`);if(`${J}`=="Invalid Date")return 0;q=J.getTime()}if(Z!==void 0){const J=new Date().getTimezoneOffset();q+=(J+Z)*60*1e3}return q}catch(q){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:N,_offset:Z,error:q}),0}},H=1e3,R$1=6e4,U=36e5,A=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=N=>W(N),E$1=(N,Z="YYYY-MM-DD hh:mm:ss",q={})=>{const J={empty_str:"-",...q},{empty_str:I,offset:D}=J,a=W(N,D);if(Number(N)!==0&&a===0)return I;const O=new Date(a),F=`${O.getFullYear()}`,z=`${O.getMonth()+1}`,K=`${O.getDate()}`,te=`${O.getDay()===0?7:O.getDay()}`,ne=`${O.getHours()}`,ee=`${O.getMinutes()}`,re=`${O.getSeconds()}`,ce=`${Math.ceil((a-L(`${F}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((a-L(`${F}/01/01 00:00:00`))/864e5-Number(te))/7)+1}`,se=[{k:"Y+",v:F},{k:"M+",v:z},{k:"D+",v:K},{k:"W+",v:te},{k:"h+",v:ne},{k:"m+",v:ee},{k:"s+",v:re},{k:"d+",v:ce},{k:"w+",v:oe}];let fe;for(let{k:ge,v:ue}of se)if(fe=new RegExp(`(${ge})`).exec(Z),fe){const _e=fe[1];let pe=ue.padStart(_e.length,"0");_e.includes("W")&&(pe=_[pe.slice(0,2)]),Z=Z.replace(_e,pe)}return Z},V=new Map,$t=(N,Z,q)=>{const J=new Date().getTime(),I=V.get(N)||0;J-q>I&&(Z(),V.set(N,J))},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(N){return N&&N.__esModule&&Object.prototype.hasOwnProperty.call(N,"default")?N.default:N}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var N=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(Z){return Z.encoding?"rtpmap:%d %s/%s/%s":Z.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(Z){return Z.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(Z){return Z.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(Z){return"extmap:%d"+(Z.direction?"/%s":"%v")+(Z["encrypt-uri"]?" %s":"%v")+" %s"+(Z.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(Z){return Z.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(Z){var q="candidate:%s %d %s %d %s %d typ %s";return q+=Z.raddr!=null?" raddr %s rport %d":"%v%v",q+=Z.tcptype!=null?" tcptype %s":"%v",Z.generation!=null&&(q+=" generation %d"),q+=Z["network-id"]!=null?" network-id %d":"%v",q+=Z["network-cost"]!=null?" network-cost %d":"%v",q}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(Z){var q="ssrc:%d";return Z.attribute!=null&&(q+=" %s",Z.value!=null&&(q+=":%s")),q}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(Z){return Z.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(Z){return Z.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(Z){return"imageattr:%s %s %s"+(Z.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(Z){return"simulcast:%s %s"+(Z.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(Z){return"ts-refclk:%s"+(Z.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(Z){var q="mediaclk:";return q+=Z.id!=null?"id=%s %s":"%v%s",q+=Z.mediaClockValue!=null?"=%s":"",q+=Z.rateNumerator!=null?" rate=%s":"",q+=Z.rateDenominator!=null?"/%s":"",q}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(N).forEach(function(Z){var q=N[Z];q.forEach(function(J){J.reg||(J.reg=/(.*)/),J.format||(J.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(N){var Z=function(O){return String(Number(O))===O?Number(O):O},q=function(O,F,z,K){if(K&&!z)F[K]=Z(O[1]);else for(var te=0;te<z.length;te+=1)O[te+1]!=null&&(F[z[te]]=Z(O[te+1]))},J=function(O,F,z){var K=O.name&&O.names;O.push&&!F[O.push]?F[O.push]=[]:K&&!F[O.name]&&(F[O.name]={});var te=O.push?{}:K?F[O.name]:F;q(z.match(O.reg),te,O.names,O.name),O.push&&F[O.push].push(te)},I=requireGrammar(),D=RegExp.prototype.test.bind(/^([a-z])=(.*)/);N.parse=function(O){var F={},z=[],K=F;return O.split(/(\r\n|\r|\n)/).filter(D).forEach(function(te){var ne=te[0],ee=te.slice(2);ne==="m"&&(z.push({rtp:[],fmtp:[]}),K=z[z.length-1]);for(var re=0;re<(I[ne]||[]).length;re+=1){var ce=I[ne][re];if(ce.reg.test(ee))return J(ce,K,ee)}}),F.media=z,F};var a=function(O,F){var z=F.split(/=(.+)/,2);return z.length===2?O[z[0]]=Z(z[1]):z.length===1&&F.length>1&&(O[z[0]]=void 0),O};N.parseParams=function(O){return O.split(/;\s?/).reduce(a,{})},N.parseFmtpConfig=N.parseParams,N.parsePayloads=function(O){return O.toString().split(" ").map(Number)},N.parseRemoteCandidates=function(O){for(var F=[],z=O.split(" ").map(Z),K=0;K<z.length;K+=3)F.push({component:z[K],ip:z[K+1],port:z[K+2]});return F},N.parseImageAttributes=function(O){return O.split(" ").map(function(F){return F.substring(1,F.length-1).split(",").reduce(a,{})})},N.parseSimulcastStreamList=function(O){return O.split(";").map(function(F){return F.split(",").map(function(z){var K,te=!1;return z[0]!=="~"?K=Z(z):(K=Z(z.substring(1,z.length)),te=!0),{scid:K,paused:te}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var N=requireGrammar(),Z=/%[sdv%]/g,q=function(a){var O=1,F=arguments,z=F.length;return a.replace(Z,function(K){if(O>=z)return K;var te=F[O];switch(O+=1,K){case"%%":return"%";case"%s":return String(te);case"%d":return Number(te);case"%v":return""}})},J=function(a,O,F){var z=O.format instanceof Function?O.format(O.push?F:F[O.name]):O.format,K=[a+"="+z];if(O.names)for(var te=0;te<O.names.length;te+=1){var ne=O.names[te];O.name?K.push(F[O.name][ne]):K.push(F[O.names[te]])}else K.push(F[O.name]);return q.apply(null,K)},I=["v","o","s","i","u","e","p","c","b","t","r","z","a"],D=["i","c","b","a"];return writer$1=function(a,O){O=O||{},a.version==null&&(a.version=0),a.name==null&&(a.name=" "),a.media.forEach(function(te){te.payloads==null&&(te.payloads="")});var F=O.outerOrder||I,z=O.innerOrder||D,K=[];return F.forEach(function(te){N[te].forEach(function(ne){ne.name in a&&a[ne.name]!=null?K.push(J(te,ne,a)):ne.push in a&&a[ne.push]!=null&&a[ne.push].forEach(function(ee){K.push(J(te,ne,ee))})})}),a.media.forEach(function(te){K.push(J("m",N.m[0],te)),z.forEach(function(ne){N[ne].forEach(function(ee){ee.name in te&&te[ee.name]!=null?K.push(J(ne,ee,te)):ee.push in te&&te[ee.push]!=null&&te[ee.push].forEach(function(re){K.push(J(ne,ee,re))})})})}),K.join(`\r
|
|
1
|
+
(function(mt,ct){typeof exports=="object"&&typeof module<"u"?ct(exports):typeof define=="function"&&define.amd?define(["exports"],ct):(mt=typeof globalThis<"u"?globalThis:mt||self,ct(mt["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var nr=Object.defineProperty;var er=mt=>{throw TypeError(mt)};var rr=(mt,ct,Bt)=>ct in mt?nr(mt,ct,{enumerable:!0,configurable:!0,writable:!0,value:Bt}):mt[ct]=Bt;var Se=(mt,ct,Bt)=>rr(mt,typeof ct!="symbol"?ct+"":ct,Bt),tr=(mt,ct,Bt)=>ct.has(mt)||er("Cannot "+Bt);var Re=(mt,ct,Bt)=>(tr(mt,ct,"read from private field"),Bt?Bt.call(mt):ct.get(mt)),Xe=(mt,ct,Bt)=>ct.has(mt)?er("Cannot add the same private member more than once"):ct instanceof WeakSet?ct.add(mt):ct.set(mt,Bt),Et=(mt,ct,Bt,Ft)=>(tr(mt,ct,"write to private field"),Ft?Ft.call(mt,Bt):ct.set(mt,Bt),Bt);var mt,ct,Bt,Ft,Gt,$n,Dn,Bn,Sn,Nn,Mn,qn,Kt,dn,un,Tn,On,rn,an,hn,pn,En,bn,Qt,Ut,on,sn,fn,_n,Pn,Un,wn,Ln,In,Hn,Fn,jn,gn,xn,zn,kn,Rn,An,Jn,mn,Wn,Vn,Zn,Gn;const lt=($,z={})=>{const D={unit:"B",splitStr:" ",...z};let{unit:j,splitStr:O}=D;const I=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=I.findIndex(F=>F===j),k=I.slice(o+1,I.length);let N=$;for(const F of k)if(j=F,N=N/1024,N<1024)break;return`${N.toFixed(2)}${O}${j}`},P$1=($,z=[])=>{const D={...$},j=Object.keys(D);for(const O of j)z.findIndex(I=>String(I)===O)===-1&&delete D[O];return D},pt=($,z=[],D=!0)=>{const j=new Map;for(const I of $){const o=[];for(const N of z)o.push(I[N]);const k=`map-${o.join("-")}`;if(!j.has(k)){j.set(k,I);continue}D&&j.set(k,I)}const O=j.entries();return Array.from(O,([I,o])=>o)},dt=($,z=[])=>{const D=[];for(const j of $){const O=P$1(j,z);D.push(O)}return D},ht=($,z="value",D="label")=>{const j=[],O=Object.entries($);for(const[I,o]of O){const k={[D]:o,[z]:I};j.push(k)}return j},v$1=($=0,z=1)=>{const D=Math.max(0,$),j=Math.max(1,z),O=Math.random()*(j-D+1)+D;return parseInt(`${O}`,10)},xt=($=16,z=16)=>{const D="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),j=Math.min(D.length,z),O=Date.now().toString(j),I=O.split(""),o=Math.max(4,$-O.length);for(let k=0;k<o;k++){const N=v$1(0,j-1),F=D[N];I.push(F)}return I.join("").toUpperCase()},W=($,z)=>{try{let D=Number($);if(isNaN(D)){const j=new Date(`${$}`);if(`${j}`=="Invalid Date")return 0;D=j.getTime()}if(z!==void 0){const j=new Date().getTimezoneOffset();D+=(j+z)*60*1e3}return D}catch(D){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:$,_offset:z,error:D}),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=$=>W($),E=($,z="YYYY-MM-DD hh:mm:ss",D={})=>{const j={empty_str:"-",...D},{empty_str:O,offset:I}=j,o=W($,I);if(Number($)!==0&&o===0)return O;const k=new Date(o),N=`${k.getFullYear()}`,F=`${k.getMonth()+1}`,J=`${k.getDate()}`,X=`${k.getDay()===0?7:k.getDay()}`,Y=`${k.getHours()}`,Q=`${k.getMinutes()}`,te=`${k.getSeconds()}`,ie=`${Math.ceil((o-L(`${N}/01/01 00:00:00`)+1)/864e5)}`,ne=`${Math.ceil(((o-L(`${N}/01/01 00:00:00`))/864e5-Number(X))/7)+1}`,oe=[{k:"Y+",v:N},{k:"M+",v:F},{k:"D+",v:J},{k:"W+",v:X},{k:"h+",v:Y},{k:"m+",v:Q},{k:"s+",v:te},{k:"d+",v:ie},{k:"w+",v:ne}];let ce;for(let{k:we,v:se}of oe)if(ce=new RegExp(`(${we})`).exec(z),ce){const ye=ce[1];let fe=se.padStart(ye.length,"0");ye.includes("W")&&(fe=_[fe.slice(0,2)]),z=z.replace(ye,fe)}return z},V=new Map,$t=($,z,D)=>{const j=new Date().getTime(),O=V.get($)||0;j-D>O&&(z(),V.set($,j))},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($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var $=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(z){return z.encoding?"rtpmap:%d %s/%s/%s":z.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(z){return z.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(z){return z.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(z){return"extmap:%d"+(z.direction?"/%s":"%v")+(z["encrypt-uri"]?" %s":"%v")+" %s"+(z.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(z){return z.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(z){var D="candidate:%s %d %s %d %s %d typ %s";return D+=z.raddr!=null?" raddr %s rport %d":"%v%v",D+=z.tcptype!=null?" tcptype %s":"%v",z.generation!=null&&(D+=" generation %d"),D+=z["network-id"]!=null?" network-id %d":"%v",D+=z["network-cost"]!=null?" network-cost %d":"%v",D}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(z){var D="ssrc:%d";return z.attribute!=null&&(D+=" %s",z.value!=null&&(D+=":%s")),D}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(z){return z.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(z){return z.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(z){return"imageattr:%s %s %s"+(z.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(z){return"simulcast:%s %s"+(z.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(z){return"ts-refclk:%s"+(z.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(z){var D="mediaclk:";return D+=z.id!=null?"id=%s %s":"%v%s",D+=z.mediaClockValue!=null?"=%s":"",D+=z.rateNumerator!=null?" rate=%s":"",D+=z.rateDenominator!=null?"/%s":"",D}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys($).forEach(function(z){var D=$[z];D.forEach(function(j){j.reg||(j.reg=/(.*)/),j.format||(j.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function($){var z=function(k){return String(Number(k))===k?Number(k):k},D=function(k,N,F,J){if(J&&!F)N[J]=z(k[1]);else for(var X=0;X<F.length;X+=1)k[X+1]!=null&&(N[F[X]]=z(k[X+1]))},j=function(k,N,F){var J=k.name&&k.names;k.push&&!N[k.push]?N[k.push]=[]:J&&!N[k.name]&&(N[k.name]={});var X=k.push?{}:J?N[k.name]:N;D(F.match(k.reg),X,k.names,k.name),k.push&&N[k.push].push(X)},O=requireGrammar(),I=RegExp.prototype.test.bind(/^([a-z])=(.*)/);$.parse=function(k){var N={},F=[],J=N;return k.split(/(\r\n|\r|\n)/).filter(I).forEach(function(X){var Y=X[0],Q=X.slice(2);Y==="m"&&(F.push({rtp:[],fmtp:[]}),J=F[F.length-1]);for(var te=0;te<(O[Y]||[]).length;te+=1){var ie=O[Y][te];if(ie.reg.test(Q))return j(ie,J,Q)}}),N.media=F,N};var o=function(k,N){var F=N.split(/=(.+)/,2);return F.length===2?k[F[0]]=z(F[1]):F.length===1&&N.length>1&&(k[F[0]]=void 0),k};$.parseParams=function(k){return k.split(/;\s?/).reduce(o,{})},$.parseFmtpConfig=$.parseParams,$.parsePayloads=function(k){return k.toString().split(" ").map(Number)},$.parseRemoteCandidates=function(k){for(var N=[],F=k.split(" ").map(z),J=0;J<F.length;J+=3)N.push({component:F[J],ip:F[J+1],port:F[J+2]});return N},$.parseImageAttributes=function(k){return k.split(" ").map(function(N){return N.substring(1,N.length-1).split(",").reduce(o,{})})},$.parseSimulcastStreamList=function(k){return k.split(";").map(function(N){return N.split(",").map(function(F){var J,X=!1;return F[0]!=="~"?J=z(F):(J=z(F.substring(1,F.length)),X=!0),{scid:J,paused:X}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var $=requireGrammar(),z=/%[sdv%]/g,D=function(o){var k=1,N=arguments,F=N.length;return o.replace(z,function(J){if(k>=F)return J;var X=N[k];switch(k+=1,J){case"%%":return"%";case"%s":return String(X);case"%d":return Number(X);case"%v":return""}})},j=function(o,k,N){var F=k.format instanceof Function?k.format(k.push?N:N[k.name]):k.format,J=[o+"="+F];if(k.names)for(var X=0;X<k.names.length;X+=1){var Y=k.names[X];k.name?J.push(N[k.name][Y]):J.push(N[k.names[X]])}else J.push(N[k.name]);return D.apply(null,J)},O=["v","o","s","i","u","e","p","c","b","t","r","z","a"],I=["i","c","b","a"];return writer$1=function(o,k){k=k||{},o.version==null&&(o.version=0),o.name==null&&(o.name=" "),o.media.forEach(function(X){X.payloads==null&&(X.payloads="")});var N=k.outerOrder||O,F=k.innerOrder||I,J=[];return N.forEach(function(X){$[X].forEach(function(Y){Y.name in o&&o[Y.name]!=null?J.push(j(X,Y,o)):Y.push in o&&o[Y.push]!=null&&o[Y.push].forEach(function(Q){J.push(j(X,Y,Q))})})}),o.media.forEach(function(X){J.push(j("m",$.m[0],X)),F.forEach(function(Y){$[Y].forEach(function(Q){Q.name in X&&X[Q.name]!=null?J.push(j(Y,Q,X)):Q.push in X&&X[Q.push]!=null&&X[Q.push].forEach(function(te){J.push(j(Y,Q,te))})})})}),J.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var N=requireParser(),Z=requireWriter$1(),q=requireGrammar();return lib$1.grammar=q,lib$1.write=Z,lib$1.parse=N.parse,lib$1.parseParams=N.parseParams,lib$1.parseFmtpConfig=N.parseFmtpConfig,lib$1.parsePayloads=N.parsePayloads,lib$1.parseRemoteCandidates=N.parseRemoteCandidates,lib$1.parseImageAttributes=N.parseImageAttributes,lib$1.parseSimulcastStreamList=N.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(Z){Ee(this,"kind","video");Ee(this,"stream",new MediaStream);Ee(this,"stop",()=>{const Z=this.stream.getTracks();for(const q of Z)q.stop(),this.stream.removeTrack(q)});Ee(this,"replaceStream",Z=>{const q=this.stream,J=q.getTracks();for(const D of J)q.removeTrack(D);const[I]=Z.getVideoTracks();I&&q.addTrack(I)});Ee(this,"getStream",()=>this.stream);Ee(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(Z)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=N=>{throw TypeError(N)},S=(N,Z,q)=>Z in N?C$1(N,Z,{enumerable:!0,configurable:!0,writable:!0,value:q}):N[Z]=q,l=(N,Z,q)=>S(N,typeof Z!="symbol"?Z+"":Z,q),v=(N,Z,q)=>Z.has(N)||R("Cannot "+q),t$2=(N,Z,q)=>(v(N,Z,"read from private field"),q?q.call(N):Z.get(N)),c$1=(N,Z,q)=>Z.has(N)?R("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(N):Z.set(N,q),i=(N,Z,q,J)=>(v(N,Z,"write to private field"),Z.set(N,q),q),s,r$2,h,p,m$2,f,w,x,g$2,b,B$1,y,T,d$1;class M{constructor(Z){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:q=>!0,onReconnectSuccess:async q=>{},onReconnectStop:async q=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:q=>{}}),l(this,"ws"),c$1(this,r$2,-1),c$1(this,h,-1),c$1(this,p,0),c$1(this,m$2,0),c$1(this,f,!1),c$1(this,w,q=>{}),l(this,"close",async(q=1e3,J="correctly close.")=>{var I;this.ws&&(i(this,f,!0),t$2(this,d$1).call(this),(I=this.ws)==null||I.close(q,J))}),l(this,"connect",()=>new Promise(async q=>{i(this,w,q),this.ws=new WebSocket(t$2(this,s).url),this.ws.binaryType=t$2(this,s).binaryType,this.ws.onopen=t$2(this,b),this.ws.onmessage=t$2(this,g$2),this.ws.onerror=t$2(this,B$1),this.ws.onclose=t$2(this,y)})),l(this,"reconnect",async q=>new Promise(J=>{t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const I=D=>{t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${D}`),t$2(this,s).onReconnectStop({msg:D}),J(D)};if(t$2(this,x).call(this)===!1)return I("stop reconnect. exceed maxReconnectionTime.");if(t$2(this,r$2)!==-1&&t$2(this,r$2)===0)return I("stop reconnect. surplusReconnectCount is 0.");if(!t$2(this,s).checkReconnect(q))return I("stop reconnect. checkReconnect is false.");t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t$2(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$2(this,r$2)}`,q),i(this,p,setTimeout(async()=>{i(this,r$2,Math.max(-1,t$2(this,r$2)-1)),await this.connect();try{await t$2(this,s).onReconnectSuccess(this.ws)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",D)}J(!0)},t$2(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async q=>{var J;(!this.ws||this.ws.readyState!==1)&&(t$2(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t$2(this,s).sendBeforAutoConnect&&(t$2(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(J=this.ws)==null||J.send(q)}),c$1(this,x,()=>{const q=Date.now();return t$2(this,h)===-1&&i(this,h,q+t$2(this,s).reconnectTime),!(q>t$2(this,h))}),c$1(this,g$2,q=>{const{data:J}=q;t$2(this,s).onMessage(J)}),c$1(this,b,()=>{t$2(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r$2,t$2(this,s).reconnectCount),i(this,h,-1),t$2(this,T).call(this),t$2(this,w).call(this,this.ws)}),c$1(this,B$1,q=>{t$2(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",q)}),c$1(this,y,q=>{if(t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${q.code}, permanentClosed is ${t$2(this,f)}.`,q),t$2(this,d$1).call(this),!t$2(this,f))return this.reconnect(q);this.ws=void 0}),c$1(this,T,()=>{i(this,m$2,setInterval(()=>{const q=t$2(this,s).getHeartbeatMsg();q&&this.sendMessage(q)},t$2(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t$2(this,p)),clearInterval(t$2(this,m$2))}),i(this,s,{...t$2(this,s),...Z}),i(this,r$2,t$2(this,s).reconnectCount)}}s=new WeakMap,r$2=new WeakMap,h=new WeakMap,p=new WeakMap,m$2=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,g$2=new WeakMap,b=new WeakMap,B$1=new WeakMap,y=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=N;function N(Z,q){for(var J=new Array(arguments.length-1),I=0,D=2,a=!0;D<arguments.length;)J[I++]=arguments[D++];return new Promise(function(F,z){J[I]=function(te){if(a)if(a=!1,te)z(te);else{for(var ne=new Array(arguments.length-1),ee=0;ee<ne.length;)ne[ee++]=arguments[ee];F.apply(null,ne)}};try{Z.apply(q||null,J)}catch(K){a&&(a=!1,z(K))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(N){var Z=N;Z.length=function(O){var F=O.length;if(!F)return 0;for(var z=0;--F%4>1&&O.charAt(F)==="=";)++z;return Math.ceil(O.length*3)/4-z};for(var q=new Array(64),J=new Array(123),I=0;I<64;)J[q[I]=I<26?I+65:I<52?I+71:I<62?I-4:I-59|43]=I++;Z.encode=function(O,F,z){for(var K=null,te=[],ne=0,ee=0,re;F<z;){var ce=O[F++];switch(ee){case 0:te[ne++]=q[ce>>2],re=(ce&3)<<4,ee=1;break;case 1:te[ne++]=q[re|ce>>4],re=(ce&15)<<2,ee=2;break;case 2:te[ne++]=q[re|ce>>6],te[ne++]=q[ce&63],ee=0;break}ne>8191&&((K||(K=[])).push(String.fromCharCode.apply(String,te)),ne=0)}return ee&&(te[ne++]=q[re],te[ne++]=61,ee===1&&(te[ne++]=61)),K?(ne&&K.push(String.fromCharCode.apply(String,te.slice(0,ne))),K.join("")):String.fromCharCode.apply(String,te.slice(0,ne))};var D="invalid encoding";Z.decode=function(O,F,z){for(var K=z,te=0,ne,ee=0;ee<O.length;){var re=O.charCodeAt(ee++);if(re===61&&te>1)break;if((re=J[re])===void 0)throw Error(D);switch(te){case 0:ne=re,te=1;break;case 1:F[z++]=ne<<2|(re&48)>>4,ne=re,te=2;break;case 2:F[z++]=(ne&15)<<4|(re&60)>>2,ne=re,te=3;break;case 3:F[z++]=(ne&3)<<6|re,te=0;break}}if(te===1)throw Error(D);return z-K},Z.test=function(O){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(O)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=N;function N(){this._listeners={}}return N.prototype.on=function(q,J,I){return(this._listeners[q]||(this._listeners[q]=[])).push({fn:J,ctx:I||this}),this},N.prototype.off=function(q,J){if(q===void 0)this._listeners={};else if(J===void 0)this._listeners[q]=[];else for(var I=this._listeners[q],D=0;D<I.length;)I[D].fn===J?I.splice(D,1):++D;return this},N.prototype.emit=function(q){var J=this._listeners[q];if(J){for(var I=[],D=1;D<arguments.length;)I.push(arguments[D++]);for(D=0;D<J.length;)J[D].fn.apply(J[D++].ctx,I)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=N(N);function N(D){return typeof Float32Array<"u"?function(){var a=new Float32Array([-0]),O=new Uint8Array(a.buffer),F=O[3]===128;function z(ee,re,ce){a[0]=ee,re[ce]=O[0],re[ce+1]=O[1],re[ce+2]=O[2],re[ce+3]=O[3]}function K(ee,re,ce){a[0]=ee,re[ce]=O[3],re[ce+1]=O[2],re[ce+2]=O[1],re[ce+3]=O[0]}D.writeFloatLE=F?z:K,D.writeFloatBE=F?K:z;function te(ee,re){return O[0]=ee[re],O[1]=ee[re+1],O[2]=ee[re+2],O[3]=ee[re+3],a[0]}function ne(ee,re){return O[3]=ee[re],O[2]=ee[re+1],O[1]=ee[re+2],O[0]=ee[re+3],a[0]}D.readFloatLE=F?te:ne,D.readFloatBE=F?ne:te}():function(){function a(F,z,K,te){var ne=z<0?1:0;if(ne&&(z=-z),z===0)F(1/z>0?0:2147483648,K,te);else if(isNaN(z))F(2143289344,K,te);else if(z>34028234663852886e22)F((ne<<31|2139095040)>>>0,K,te);else if(z<11754943508222875e-54)F((ne<<31|Math.round(z/1401298464324817e-60))>>>0,K,te);else{var ee=Math.floor(Math.log(z)/Math.LN2),re=Math.round(z*Math.pow(2,-ee)*8388608)&8388607;F((ne<<31|ee+127<<23|re)>>>0,K,te)}}D.writeFloatLE=a.bind(null,Z),D.writeFloatBE=a.bind(null,q);function O(F,z,K){var te=F(z,K),ne=(te>>31)*2+1,ee=te>>>23&255,re=te&8388607;return ee===255?re?NaN:ne*(1/0):ee===0?ne*1401298464324817e-60*re:ne*Math.pow(2,ee-150)*(re+8388608)}D.readFloatLE=O.bind(null,J),D.readFloatBE=O.bind(null,I)}(),typeof Float64Array<"u"?function(){var a=new Float64Array([-0]),O=new Uint8Array(a.buffer),F=O[7]===128;function z(ee,re,ce){a[0]=ee,re[ce]=O[0],re[ce+1]=O[1],re[ce+2]=O[2],re[ce+3]=O[3],re[ce+4]=O[4],re[ce+5]=O[5],re[ce+6]=O[6],re[ce+7]=O[7]}function K(ee,re,ce){a[0]=ee,re[ce]=O[7],re[ce+1]=O[6],re[ce+2]=O[5],re[ce+3]=O[4],re[ce+4]=O[3],re[ce+5]=O[2],re[ce+6]=O[1],re[ce+7]=O[0]}D.writeDoubleLE=F?z:K,D.writeDoubleBE=F?K:z;function te(ee,re){return O[0]=ee[re],O[1]=ee[re+1],O[2]=ee[re+2],O[3]=ee[re+3],O[4]=ee[re+4],O[5]=ee[re+5],O[6]=ee[re+6],O[7]=ee[re+7],a[0]}function ne(ee,re){return O[7]=ee[re],O[6]=ee[re+1],O[5]=ee[re+2],O[4]=ee[re+3],O[3]=ee[re+4],O[2]=ee[re+5],O[1]=ee[re+6],O[0]=ee[re+7],a[0]}D.readDoubleLE=F?te:ne,D.readDoubleBE=F?ne:te}():function(){function a(F,z,K,te,ne,ee){var re=te<0?1:0;if(re&&(te=-te),te===0)F(0,ne,ee+z),F(1/te>0?0:2147483648,ne,ee+K);else if(isNaN(te))F(0,ne,ee+z),F(2146959360,ne,ee+K);else if(te>17976931348623157e292)F(0,ne,ee+z),F((re<<31|2146435072)>>>0,ne,ee+K);else{var ce;if(te<22250738585072014e-324)ce=te/5e-324,F(ce>>>0,ne,ee+z),F((re<<31|ce/4294967296)>>>0,ne,ee+K);else{var oe=Math.floor(Math.log(te)/Math.LN2);oe===1024&&(oe=1023),ce=te*Math.pow(2,-oe),F(ce*4503599627370496>>>0,ne,ee+z),F((re<<31|oe+1023<<20|ce*1048576&1048575)>>>0,ne,ee+K)}}}D.writeDoubleLE=a.bind(null,Z,0,4),D.writeDoubleBE=a.bind(null,q,4,0);function O(F,z,K,te,ne){var ee=F(te,ne+z),re=F(te,ne+K),ce=(re>>31)*2+1,oe=re>>>20&2047,se=4294967296*(re&1048575)+ee;return oe===2047?se?NaN:ce*(1/0):oe===0?ce*5e-324*se:ce*Math.pow(2,oe-1075)*(se+4503599627370496)}D.readDoubleLE=O.bind(null,J,0,4),D.readDoubleBE=O.bind(null,I,4,0)}(),D}function Z(D,a,O){a[O]=D&255,a[O+1]=D>>>8&255,a[O+2]=D>>>16&255,a[O+3]=D>>>24}function q(D,a,O){a[O]=D>>>24,a[O+1]=D>>>16&255,a[O+2]=D>>>8&255,a[O+3]=D&255}function J(D,a){return(D[a]|D[a+1]<<8|D[a+2]<<16|D[a+3]<<24)>>>0}function I(D,a){return(D[a]<<24|D[a+1]<<16|D[a+2]<<8|D[a+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(N){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(N){var Z=N;Z.length=function(J){for(var I=0,D=0,a=0;a<J.length;++a)D=J.charCodeAt(a),D<128?I+=1:D<2048?I+=2:(D&64512)===55296&&(J.charCodeAt(a+1)&64512)===56320?(++a,I+=4):I+=3;return I},Z.read=function(J,I,D){var a=D-I;if(a<1)return"";for(var O=null,F=[],z=0,K;I<D;)K=J[I++],K<128?F[z++]=K:K>191&&K<224?F[z++]=(K&31)<<6|J[I++]&63:K>239&&K<365?(K=((K&7)<<18|(J[I++]&63)<<12|(J[I++]&63)<<6|J[I++]&63)-65536,F[z++]=55296+(K>>10),F[z++]=56320+(K&1023)):F[z++]=(K&15)<<12|(J[I++]&63)<<6|J[I++]&63,z>8191&&((O||(O=[])).push(String.fromCharCode.apply(String,F)),z=0);return O?(z&&O.push(String.fromCharCode.apply(String,F.slice(0,z))),O.join("")):String.fromCharCode.apply(String,F.slice(0,z))},Z.write=function(J,I,D){for(var a=D,O,F,z=0;z<J.length;++z)O=J.charCodeAt(z),O<128?I[D++]=O:O<2048?(I[D++]=O>>6|192,I[D++]=O&63|128):(O&64512)===55296&&((F=J.charCodeAt(z+1))&64512)===56320?(O=65536+((O&1023)<<10)+(F&1023),++z,I[D++]=O>>18|240,I[D++]=O>>12&63|128,I[D++]=O>>6&63|128,I[D++]=O&63|128):(I[D++]=O>>12|224,I[D++]=O>>6&63|128,I[D++]=O&63|128);return D-a}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=N;function N(Z,q,J){var I=J||8192,D=I>>>1,a=null,O=I;return function(z){if(z<1||z>D)return Z(z);O+z>I&&(a=Z(I),O=0);var K=q.call(a,O,O+=z);return O&7&&(O=(O|7)+1),K}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=Z;var N=requireMinimal$1();function Z(D,a){this.lo=D>>>0,this.hi=a>>>0}var q=Z.zero=new Z(0,0);q.toNumber=function(){return 0},q.zzEncode=q.zzDecode=function(){return this},q.length=function(){return 1};var J=Z.zeroHash="\0\0\0\0\0\0\0\0";Z.fromNumber=function(a){if(a===0)return q;var O=a<0;O&&(a=-a);var F=a>>>0,z=(a-F)/4294967296>>>0;return O&&(z=~z>>>0,F=~F>>>0,++F>4294967295&&(F=0,++z>4294967295&&(z=0))),new Z(F,z)},Z.from=function(a){if(typeof a=="number")return Z.fromNumber(a);if(N.isString(a))if(N.Long)a=N.Long.fromString(a);else return Z.fromNumber(parseInt(a,10));return a.low||a.high?new Z(a.low>>>0,a.high>>>0):q},Z.prototype.toNumber=function(a){if(!a&&this.hi>>>31){var O=~this.lo+1>>>0,F=~this.hi>>>0;return O||(F=F+1>>>0),-(O+F*4294967296)}return this.lo+this.hi*4294967296},Z.prototype.toLong=function(a){return N.Long?new N.Long(this.lo|0,this.hi|0,!!a):{low:this.lo|0,high:this.hi|0,unsigned:!!a}};var I=String.prototype.charCodeAt;return Z.fromHash=function(a){return a===J?q:new Z((I.call(a,0)|I.call(a,1)<<8|I.call(a,2)<<16|I.call(a,3)<<24)>>>0,(I.call(a,4)|I.call(a,5)<<8|I.call(a,6)<<16|I.call(a,7)<<24)>>>0)},Z.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},Z.prototype.zzEncode=function(){var a=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^a)>>>0,this.lo=(this.lo<<1^a)>>>0,this},Z.prototype.zzDecode=function(){var a=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^a)>>>0,this.hi=(this.hi>>>1^a)>>>0,this},Z.prototype.length=function(){var a=this.lo,O=(this.lo>>>28|this.hi<<4)>>>0,F=this.hi>>>24;return F===0?O===0?a<16384?a<128?1:2:a<2097152?3:4:O<16384?O<128?5:6:O<2097152?7:8:F<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(N){var Z=N;Z.asPromise=requireAspromise(),Z.base64=requireBase64(),Z.EventEmitter=requireEventemitter(),Z.float=requireFloat(),Z.inquire=requireInquire(),Z.utf8=requireUtf8(),Z.pool=requirePool(),Z.LongBits=requireLongbits(),Z.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),Z.global=Z.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,Z.emptyArray=Object.freeze?Object.freeze([]):[],Z.emptyObject=Object.freeze?Object.freeze({}):{},Z.isInteger=Number.isInteger||function(D){return typeof D=="number"&&isFinite(D)&&Math.floor(D)===D},Z.isString=function(D){return typeof D=="string"||D instanceof String},Z.isObject=function(D){return D&&typeof D=="object"},Z.isset=Z.isSet=function(D,a){var O=D[a];return O!=null&&D.hasOwnProperty(a)?typeof O!="object"||(Array.isArray(O)?O.length:Object.keys(O).length)>0:!1},Z.Buffer=function(){try{var I=Z.inquire("buffer").Buffer;return I.prototype.utf8Write?I:null}catch{return null}}(),Z._Buffer_from=null,Z._Buffer_allocUnsafe=null,Z.newBuffer=function(D){return typeof D=="number"?Z.Buffer?Z._Buffer_allocUnsafe(D):new Z.Array(D):Z.Buffer?Z._Buffer_from(D):typeof Uint8Array>"u"?D:new Uint8Array(D)},Z.Array=typeof Uint8Array<"u"?Uint8Array:Array,Z.Long=Z.global.dcodeIO&&Z.global.dcodeIO.Long||Z.global.Long||Z.inquire("long"),Z.key2Re=/^true|false|0|1$/,Z.key32Re=/^-?(?:0|[1-9][0-9]*)$/,Z.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,Z.longToHash=function(D){return D?Z.LongBits.from(D).toHash():Z.LongBits.zeroHash},Z.longFromHash=function(D,a){var O=Z.LongBits.fromHash(D);return Z.Long?Z.Long.fromBits(O.lo,O.hi,a):O.toNumber(!!a)};function q(I,D,a){for(var O=Object.keys(D),F=0;F<O.length;++F)(I[O[F]]===void 0||!a)&&(I[O[F]]=D[O[F]]);return I}Z.merge=q,Z.lcFirst=function(D){return D.charAt(0).toLowerCase()+D.substring(1)};function J(I){function D(a,O){if(!(this instanceof D))return new D(a,O);Object.defineProperty(this,"message",{get:function(){return a}}),Error.captureStackTrace?Error.captureStackTrace(this,D):Object.defineProperty(this,"stack",{value:new Error().stack||""}),O&&q(this,O)}return D.prototype=Object.create(Error.prototype,{constructor:{value:D,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return I},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),D}Z.newError=J,Z.ProtocolError=J("ProtocolError"),Z.oneOfGetter=function(D){for(var a={},O=0;O<D.length;++O)a[D[O]]=1;return function(){for(var F=Object.keys(this),z=F.length-1;z>-1;--z)if(a[F[z]]===1&&this[F[z]]!==void 0&&this[F[z]]!==null)return F[z]}},Z.oneOfSetter=function(D){return function(a){for(var O=0;O<D.length;++O)D[O]!==a&&delete this[D[O]]}},Z.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},Z._configure=function(){var I=Z.Buffer;if(!I){Z._Buffer_from=Z._Buffer_allocUnsafe=null;return}Z._Buffer_from=I.from!==Uint8Array.from&&I.from||function(a,O){return new I(a,O)},Z._Buffer_allocUnsafe=I.allocUnsafe||function(a){return new I(a)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=F;var N=requireMinimal$1(),Z,q=N.LongBits,J=N.base64,I=N.utf8;function D(oe,se,fe){this.fn=oe,this.len=se,this.next=void 0,this.val=fe}function a(){}function O(oe){this.head=oe.head,this.tail=oe.tail,this.len=oe.len,this.next=oe.states}function F(){this.len=0,this.head=new D(a,0,0),this.tail=this.head,this.states=null}var z=function(){return N.Buffer?function(){return(F.create=function(){return new Z})()}:function(){return new F}};F.create=z(),F.alloc=function(se){return new N.Array(se)},N.Array!==Array&&(F.alloc=N.pool(F.alloc,N.Array.prototype.subarray)),F.prototype._push=function(se,fe,ge){return this.tail=this.tail.next=new D(se,fe,ge),this.len+=fe,this};function K(oe,se,fe){se[fe]=oe&255}function te(oe,se,fe){for(;oe>127;)se[fe++]=oe&127|128,oe>>>=7;se[fe]=oe}function ne(oe,se){this.len=oe,this.next=void 0,this.val=se}ne.prototype=Object.create(D.prototype),ne.prototype.fn=te,F.prototype.uint32=function(se){return this.len+=(this.tail=this.tail.next=new ne((se=se>>>0)<128?1:se<16384?2:se<2097152?3:se<268435456?4:5,se)).len,this},F.prototype.int32=function(se){return se<0?this._push(ee,10,q.fromNumber(se)):this.uint32(se)},F.prototype.sint32=function(se){return this.uint32((se<<1^se>>31)>>>0)};function ee(oe,se,fe){for(;oe.hi;)se[fe++]=oe.lo&127|128,oe.lo=(oe.lo>>>7|oe.hi<<25)>>>0,oe.hi>>>=7;for(;oe.lo>127;)se[fe++]=oe.lo&127|128,oe.lo=oe.lo>>>7;se[fe++]=oe.lo}F.prototype.uint64=function(se){var fe=q.from(se);return this._push(ee,fe.length(),fe)},F.prototype.int64=F.prototype.uint64,F.prototype.sint64=function(se){var fe=q.from(se).zzEncode();return this._push(ee,fe.length(),fe)},F.prototype.bool=function(se){return this._push(K,1,se?1:0)};function re(oe,se,fe){se[fe]=oe&255,se[fe+1]=oe>>>8&255,se[fe+2]=oe>>>16&255,se[fe+3]=oe>>>24}F.prototype.fixed32=function(se){return this._push(re,4,se>>>0)},F.prototype.sfixed32=F.prototype.fixed32,F.prototype.fixed64=function(se){var fe=q.from(se);return this._push(re,4,fe.lo)._push(re,4,fe.hi)},F.prototype.sfixed64=F.prototype.fixed64,F.prototype.float=function(se){return this._push(N.float.writeFloatLE,4,se)},F.prototype.double=function(se){return this._push(N.float.writeDoubleLE,8,se)};var ce=N.Array.prototype.set?function(se,fe,ge){fe.set(se,ge)}:function(se,fe,ge){for(var ue=0;ue<se.length;++ue)fe[ge+ue]=se[ue]};return F.prototype.bytes=function(se){var fe=se.length>>>0;if(!fe)return this._push(K,1,0);if(N.isString(se)){var ge=F.alloc(fe=J.length(se));J.decode(se,ge,0),se=ge}return this.uint32(fe)._push(ce,fe,se)},F.prototype.string=function(se){var fe=I.length(se);return fe?this.uint32(fe)._push(I.write,fe,se):this._push(K,1,0)},F.prototype.fork=function(){return this.states=new O(this),this.head=this.tail=new D(a,0,0),this.len=0,this},F.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 D(a,0,0),this.len=0),this},F.prototype.ldelim=function(){var se=this.head,fe=this.tail,ge=this.len;return this.reset().uint32(ge),ge&&(this.tail.next=se.next,this.tail=fe,this.len+=ge),this},F.prototype.finish=function(){for(var se=this.head.next,fe=this.constructor.alloc(this.len),ge=0;se;)se.fn(se.val,fe,ge),ge+=se.len,se=se.next;return fe},F._configure=function(oe){Z=oe,F.create=z(),Z._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=q;var N=requireWriter();(q.prototype=Object.create(N.prototype)).constructor=q;var Z=requireMinimal$1();function q(){N.call(this)}q._configure=function(){q.alloc=Z._Buffer_allocUnsafe,q.writeBytesBuffer=Z.Buffer&&Z.Buffer.prototype instanceof Uint8Array&&Z.Buffer.prototype.set.name==="set"?function(D,a,O){a.set(D,O)}:function(D,a,O){if(D.copy)D.copy(a,O,0,D.length);else for(var F=0;F<D.length;)a[O++]=D[F++]}},q.prototype.bytes=function(D){Z.isString(D)&&(D=Z._Buffer_from(D,"base64"));var a=D.length>>>0;return this.uint32(a),a&&this._push(q.writeBytesBuffer,a,D),this};function J(I,D,a){I.length<40?Z.utf8.write(I,D,a):D.utf8Write?D.utf8Write(I,a):D.write(I,a)}return q.prototype.string=function(D){var a=Z.Buffer.byteLength(D);return this.uint32(a),a&&this._push(J,a,D),this},q._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=D;var N=requireMinimal$1(),Z,q=N.LongBits,J=N.utf8;function I(te,ne){return RangeError("index out of range: "+te.pos+" + "+(ne||1)+" > "+te.len)}function D(te){this.buf=te,this.pos=0,this.len=te.length}var a=typeof Uint8Array<"u"?function(ne){if(ne instanceof Uint8Array||Array.isArray(ne))return new D(ne);throw Error("illegal buffer")}:function(ne){if(Array.isArray(ne))return new D(ne);throw Error("illegal buffer")},O=function(){return N.Buffer?function(ee){return(D.create=function(ce){return N.Buffer.isBuffer(ce)?new Z(ce):a(ce)})(ee)}:a};D.create=O(),D.prototype._slice=N.Array.prototype.subarray||N.Array.prototype.slice,D.prototype.uint32=function(){var ne=4294967295;return function(){if(ne=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(ne=(ne|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(ne=(ne|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(ne=(ne|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(ne=(ne|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return ne;if((this.pos+=5)>this.len)throw this.pos=this.len,I(this,10);return ne}}(),D.prototype.int32=function(){return this.uint32()|0},D.prototype.sint32=function(){var ne=this.uint32();return ne>>>1^-(ne&1)|0};function F(){var te=new q(0,0),ne=0;if(this.len-this.pos>4){for(;ne<4;++ne)if(te.lo=(te.lo|(this.buf[this.pos]&127)<<ne*7)>>>0,this.buf[this.pos++]<128)return te;if(te.lo=(te.lo|(this.buf[this.pos]&127)<<28)>>>0,te.hi=(te.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return te;ne=0}else{for(;ne<3;++ne){if(this.pos>=this.len)throw I(this);if(te.lo=(te.lo|(this.buf[this.pos]&127)<<ne*7)>>>0,this.buf[this.pos++]<128)return te}return te.lo=(te.lo|(this.buf[this.pos++]&127)<<ne*7)>>>0,te}if(this.len-this.pos>4){for(;ne<5;++ne)if(te.hi=(te.hi|(this.buf[this.pos]&127)<<ne*7+3)>>>0,this.buf[this.pos++]<128)return te}else for(;ne<5;++ne){if(this.pos>=this.len)throw I(this);if(te.hi=(te.hi|(this.buf[this.pos]&127)<<ne*7+3)>>>0,this.buf[this.pos++]<128)return te}throw Error("invalid varint encoding")}D.prototype.bool=function(){return this.uint32()!==0};function z(te,ne){return(te[ne-4]|te[ne-3]<<8|te[ne-2]<<16|te[ne-1]<<24)>>>0}D.prototype.fixed32=function(){if(this.pos+4>this.len)throw I(this,4);return z(this.buf,this.pos+=4)},D.prototype.sfixed32=function(){if(this.pos+4>this.len)throw I(this,4);return z(this.buf,this.pos+=4)|0};function K(){if(this.pos+8>this.len)throw I(this,8);return new q(z(this.buf,this.pos+=4),z(this.buf,this.pos+=4))}return D.prototype.float=function(){if(this.pos+4>this.len)throw I(this,4);var ne=N.float.readFloatLE(this.buf,this.pos);return this.pos+=4,ne},D.prototype.double=function(){if(this.pos+8>this.len)throw I(this,4);var ne=N.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,ne},D.prototype.bytes=function(){var ne=this.uint32(),ee=this.pos,re=this.pos+ne;if(re>this.len)throw I(this,ne);if(this.pos+=ne,Array.isArray(this.buf))return this.buf.slice(ee,re);if(ee===re){var ce=N.Buffer;return ce?ce.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,ee,re)},D.prototype.string=function(){var ne=this.bytes();return J.read(ne,0,ne.length)},D.prototype.skip=function(ne){if(typeof ne=="number"){if(this.pos+ne>this.len)throw I(this,ne);this.pos+=ne}else do if(this.pos>=this.len)throw I(this);while(this.buf[this.pos++]&128);return this},D.prototype.skipType=function(te){switch(te){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(te=this.uint32()&7)!==4;)this.skipType(te);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+te+" at offset "+this.pos)}return this},D._configure=function(te){Z=te,D.create=O(),Z._configure();var ne=N.Long?"toLong":"toNumber";N.merge(D.prototype,{int64:function(){return F.call(this)[ne](!1)},uint64:function(){return F.call(this)[ne](!0)},sint64:function(){return F.call(this).zzDecode()[ne](!1)},fixed64:function(){return K.call(this)[ne](!0)},sfixed64:function(){return K.call(this)[ne](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=q;var N=requireReader();(q.prototype=Object.create(N.prototype)).constructor=q;var Z=requireMinimal$1();function q(J){N.call(this,J)}return q._configure=function(){Z.Buffer&&(q.prototype._slice=Z.Buffer.prototype.slice)},q.prototype.string=function(){var I=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+I,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+I,this.len))},q._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=Z;var N=requireMinimal$1();(Z.prototype=Object.create(N.EventEmitter.prototype)).constructor=Z;function Z(q,J,I){if(typeof q!="function")throw TypeError("rpcImpl must be a function");N.EventEmitter.call(this),this.rpcImpl=q,this.requestDelimited=!!J,this.responseDelimited=!!I}return Z.prototype.rpcCall=function q(J,I,D,a,O){if(!a)throw TypeError("request must be specified");var F=this;if(!O)return N.asPromise(q,F,J,I,D,a);if(!F.rpcImpl){setTimeout(function(){O(Error("already ended"))},0);return}try{return F.rpcImpl(J,I[F.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(K,te){if(K)return F.emit("error",K,J),O(K);if(te===null){F.end(!0);return}if(!(te instanceof D))try{te=D[F.responseDelimited?"decodeDelimited":"decode"](te)}catch(ne){return F.emit("error",ne,J),O(ne)}return F.emit("data",te,J),O(null,te)})}catch(z){F.emit("error",z,J),setTimeout(function(){O(z)},0);return}},Z.prototype.end=function(J){return this.rpcImpl&&(J||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(N){var Z=N;Z.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(N){var Z=N;Z.build="minimal",Z.Writer=requireWriter(),Z.BufferWriter=requireWriter_buffer(),Z.Reader=requireReader(),Z.BufferReader=requireReader_buffer(),Z.util=requireMinimal$1(),Z.rpc=requireRpc(),Z.roots=requireRoots(),Z.configure=q;function q(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}q()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const N={};return N.quick=function(){const Z={};return Z.voice=function(){const q={};return q.proto=function(){const J={};return J.CommonReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.version=0,I.prototype.compress=!1,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.event!=null&&Object.hasOwnProperty.call(a,"event")&&O.uint32(10).string(a.event),a.data!=null&&Object.hasOwnProperty.call(a,"data")&&O.uint32(18).bytes(a.data),a.sn!=null&&Object.hasOwnProperty.call(a,"sn")&&O.uint32(24).int64(a.sn),a.time!=null&&Object.hasOwnProperty.call(a,"time")&&O.uint32(32).int64(a.time),a.valid!=null&&Object.hasOwnProperty.call(a,"valid")&&O.uint32(40).int64(a.valid),a.version!=null&&Object.hasOwnProperty.call(a,"version")&&O.uint32(48).int32(a.version),a.compress!=null&&Object.hasOwnProperty.call(a,"compress")&&O.uint32(56).bool(a.compress),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.CommonReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.event=a.string();break}case 2:{z.data=a.bytes();break}case 3:{z.sn=a.int64();break}case 4:{z.time=a.int64();break}case 5:{z.valid=a.int64();break}case 6:{z.version=a.int32();break}case 7:{z.compress=a.bool();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.event!=null&&a.hasOwnProperty("event")&&!$util.isString(a.event)?"event: string expected":a.data!=null&&a.hasOwnProperty("data")&&!(a.data&&typeof a.data.length=="number"||$util.isString(a.data))?"data: buffer expected":a.sn!=null&&a.hasOwnProperty("sn")&&!$util.isInteger(a.sn)&&!(a.sn&&$util.isInteger(a.sn.low)&&$util.isInteger(a.sn.high))?"sn: integer|Long expected":a.time!=null&&a.hasOwnProperty("time")&&!$util.isInteger(a.time)&&!(a.time&&$util.isInteger(a.time.low)&&$util.isInteger(a.time.high))?"time: integer|Long expected":a.valid!=null&&a.hasOwnProperty("valid")&&!$util.isInteger(a.valid)&&!(a.valid&&$util.isInteger(a.valid.low)&&$util.isInteger(a.valid.high))?"valid: integer|Long expected":a.version!=null&&a.hasOwnProperty("version")&&!$util.isInteger(a.version)?"version: integer expected":a.compress!=null&&a.hasOwnProperty("compress")&&typeof a.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CommonReq)return a;let O=new $root.com.quick.voice.proto.CommonReq;return a.event!=null&&(O.event=String(a.event)),a.data!=null&&(typeof a.data=="string"?$util.base64.decode(a.data,O.data=$util.newBuffer($util.base64.length(a.data)),0):a.data.length>=0&&(O.data=a.data)),a.sn!=null&&($util.Long?(O.sn=$util.Long.fromValue(a.sn)).unsigned=!1:typeof a.sn=="string"?O.sn=parseInt(a.sn,10):typeof a.sn=="number"?O.sn=a.sn:typeof a.sn=="object"&&(O.sn=new $util.LongBits(a.sn.low>>>0,a.sn.high>>>0).toNumber())),a.time!=null&&($util.Long?(O.time=$util.Long.fromValue(a.time)).unsigned=!1:typeof a.time=="string"?O.time=parseInt(a.time,10):typeof a.time=="number"?O.time=a.time:typeof a.time=="object"&&(O.time=new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber())),a.valid!=null&&($util.Long?(O.valid=$util.Long.fromValue(a.valid)).unsigned=!1:typeof a.valid=="string"?O.valid=parseInt(a.valid,10):typeof a.valid=="number"?O.valid=a.valid:typeof a.valid=="object"&&(O.valid=new $util.LongBits(a.valid.low>>>0,a.valid.high>>>0).toNumber())),a.version!=null&&(O.version=a.version|0),a.compress!=null&&(O.compress=!!a.compress),O},I.toObject=function(a,O){O||(O={});let F={};if(O.defaults){if(F.event="",O.bytes===String?F.data="":(F.data=[],O.bytes!==Array&&(F.data=$util.newBuffer(F.data))),$util.Long){let z=new $util.Long(0,0,!1);F.sn=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.sn=O.longs===String?"0":0;if($util.Long){let z=new $util.Long(0,0,!1);F.time=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.time=O.longs===String?"0":0;if($util.Long){let z=new $util.Long(0,0,!1);F.valid=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.valid=O.longs===String?"0":0;F.version=0,F.compress=!1}return a.event!=null&&a.hasOwnProperty("event")&&(F.event=a.event),a.data!=null&&a.hasOwnProperty("data")&&(F.data=O.bytes===String?$util.base64.encode(a.data,0,a.data.length):O.bytes===Array?Array.prototype.slice.call(a.data):a.data),a.sn!=null&&a.hasOwnProperty("sn")&&(typeof a.sn=="number"?F.sn=O.longs===String?String(a.sn):a.sn:F.sn=O.longs===String?$util.Long.prototype.toString.call(a.sn):O.longs===Number?new $util.LongBits(a.sn.low>>>0,a.sn.high>>>0).toNumber():a.sn),a.time!=null&&a.hasOwnProperty("time")&&(typeof a.time=="number"?F.time=O.longs===String?String(a.time):a.time:F.time=O.longs===String?$util.Long.prototype.toString.call(a.time):O.longs===Number?new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber():a.time),a.valid!=null&&a.hasOwnProperty("valid")&&(typeof a.valid=="number"?F.valid=O.longs===String?String(a.valid):a.valid:F.valid=O.longs===String?$util.Long.prototype.toString.call(a.valid):O.longs===Number?new $util.LongBits(a.valid.low>>>0,a.valid.high>>>0).toNumber():a.valid),a.version!=null&&a.hasOwnProperty("version")&&(F.version=a.version),a.compress!=null&&a.hasOwnProperty("compress")&&(F.compress=a.compress),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CommonReq"},I}(),J.CommonRsp=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.code=0,I.prototype.desc="",I.prototype.version=0,I.prototype.compress=!1,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.event!=null&&Object.hasOwnProperty.call(a,"event")&&O.uint32(10).string(a.event),a.data!=null&&Object.hasOwnProperty.call(a,"data")&&O.uint32(18).bytes(a.data),a.sn!=null&&Object.hasOwnProperty.call(a,"sn")&&O.uint32(24).int64(a.sn),a.time!=null&&Object.hasOwnProperty.call(a,"time")&&O.uint32(32).int64(a.time),a.valid!=null&&Object.hasOwnProperty.call(a,"valid")&&O.uint32(40).int64(a.valid),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&O.uint32(48).int32(a.code),a.desc!=null&&Object.hasOwnProperty.call(a,"desc")&&O.uint32(58).string(a.desc),a.version!=null&&Object.hasOwnProperty.call(a,"version")&&O.uint32(64).int32(a.version),a.compress!=null&&Object.hasOwnProperty.call(a,"compress")&&O.uint32(72).bool(a.compress),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.CommonRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.event=a.string();break}case 2:{z.data=a.bytes();break}case 3:{z.sn=a.int64();break}case 4:{z.time=a.int64();break}case 5:{z.valid=a.int64();break}case 6:{z.code=a.int32();break}case 7:{z.desc=a.string();break}case 8:{z.version=a.int32();break}case 9:{z.compress=a.bool();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.event!=null&&a.hasOwnProperty("event")&&!$util.isString(a.event)?"event: string expected":a.data!=null&&a.hasOwnProperty("data")&&!(a.data&&typeof a.data.length=="number"||$util.isString(a.data))?"data: buffer expected":a.sn!=null&&a.hasOwnProperty("sn")&&!$util.isInteger(a.sn)&&!(a.sn&&$util.isInteger(a.sn.low)&&$util.isInteger(a.sn.high))?"sn: integer|Long expected":a.time!=null&&a.hasOwnProperty("time")&&!$util.isInteger(a.time)&&!(a.time&&$util.isInteger(a.time.low)&&$util.isInteger(a.time.high))?"time: integer|Long expected":a.valid!=null&&a.hasOwnProperty("valid")&&!$util.isInteger(a.valid)&&!(a.valid&&$util.isInteger(a.valid.low)&&$util.isInteger(a.valid.high))?"valid: integer|Long expected":a.code!=null&&a.hasOwnProperty("code")&&!$util.isInteger(a.code)?"code: integer expected":a.desc!=null&&a.hasOwnProperty("desc")&&!$util.isString(a.desc)?"desc: string expected":a.version!=null&&a.hasOwnProperty("version")&&!$util.isInteger(a.version)?"version: integer expected":a.compress!=null&&a.hasOwnProperty("compress")&&typeof a.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CommonRsp)return a;let O=new $root.com.quick.voice.proto.CommonRsp;return a.event!=null&&(O.event=String(a.event)),a.data!=null&&(typeof a.data=="string"?$util.base64.decode(a.data,O.data=$util.newBuffer($util.base64.length(a.data)),0):a.data.length>=0&&(O.data=a.data)),a.sn!=null&&($util.Long?(O.sn=$util.Long.fromValue(a.sn)).unsigned=!1:typeof a.sn=="string"?O.sn=parseInt(a.sn,10):typeof a.sn=="number"?O.sn=a.sn:typeof a.sn=="object"&&(O.sn=new $util.LongBits(a.sn.low>>>0,a.sn.high>>>0).toNumber())),a.time!=null&&($util.Long?(O.time=$util.Long.fromValue(a.time)).unsigned=!1:typeof a.time=="string"?O.time=parseInt(a.time,10):typeof a.time=="number"?O.time=a.time:typeof a.time=="object"&&(O.time=new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber())),a.valid!=null&&($util.Long?(O.valid=$util.Long.fromValue(a.valid)).unsigned=!1:typeof a.valid=="string"?O.valid=parseInt(a.valid,10):typeof a.valid=="number"?O.valid=a.valid:typeof a.valid=="object"&&(O.valid=new $util.LongBits(a.valid.low>>>0,a.valid.high>>>0).toNumber())),a.code!=null&&(O.code=a.code|0),a.desc!=null&&(O.desc=String(a.desc)),a.version!=null&&(O.version=a.version|0),a.compress!=null&&(O.compress=!!a.compress),O},I.toObject=function(a,O){O||(O={});let F={};if(O.defaults){if(F.event="",O.bytes===String?F.data="":(F.data=[],O.bytes!==Array&&(F.data=$util.newBuffer(F.data))),$util.Long){let z=new $util.Long(0,0,!1);F.sn=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.sn=O.longs===String?"0":0;if($util.Long){let z=new $util.Long(0,0,!1);F.time=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.time=O.longs===String?"0":0;if($util.Long){let z=new $util.Long(0,0,!1);F.valid=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.valid=O.longs===String?"0":0;F.code=0,F.desc="",F.version=0,F.compress=!1}return a.event!=null&&a.hasOwnProperty("event")&&(F.event=a.event),a.data!=null&&a.hasOwnProperty("data")&&(F.data=O.bytes===String?$util.base64.encode(a.data,0,a.data.length):O.bytes===Array?Array.prototype.slice.call(a.data):a.data),a.sn!=null&&a.hasOwnProperty("sn")&&(typeof a.sn=="number"?F.sn=O.longs===String?String(a.sn):a.sn:F.sn=O.longs===String?$util.Long.prototype.toString.call(a.sn):O.longs===Number?new $util.LongBits(a.sn.low>>>0,a.sn.high>>>0).toNumber():a.sn),a.time!=null&&a.hasOwnProperty("time")&&(typeof a.time=="number"?F.time=O.longs===String?String(a.time):a.time:F.time=O.longs===String?$util.Long.prototype.toString.call(a.time):O.longs===Number?new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber():a.time),a.valid!=null&&a.hasOwnProperty("valid")&&(typeof a.valid=="number"?F.valid=O.longs===String?String(a.valid):a.valid:F.valid=O.longs===String?$util.Long.prototype.toString.call(a.valid):O.longs===Number?new $util.LongBits(a.valid.low>>>0,a.valid.high>>>0).toNumber():a.valid),a.code!=null&&a.hasOwnProperty("code")&&(F.code=a.code),a.desc!=null&&a.hasOwnProperty("desc")&&(F.desc=a.desc),a.version!=null&&a.hasOwnProperty("version")&&(F.version=a.version),a.compress!=null&&a.hasOwnProperty("compress")&&(F.compress=a.compress),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CommonRsp"},I}(),J.User=function(){function I(a){if(this.tracks=[],a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.id="",I.prototype.callAction=null,I.prototype.callState=null,I.prototype.joinTime=null,I.prototype.tracks=$util.emptyArray,I.prototype.permissions=null,I.prototype.isPublished=null,I.prototype.behavior=null,I.prototype.channelCache=null;let D;return Object.defineProperty(I.prototype,"_callAction",{get:$util.oneOfGetter(D=["callAction"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_callState",{get:$util.oneOfGetter(D=["callState"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_joinTime",{get:$util.oneOfGetter(D=["joinTime"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_permissions",{get:$util.oneOfGetter(D=["permissions"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_isPublished",{get:$util.oneOfGetter(D=["isPublished"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_behavior",{get:$util.oneOfGetter(D=["behavior"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_channelCache",{get:$util.oneOfGetter(D=["channelCache"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){if(F||(F=$Writer.create()),O.id!=null&&Object.hasOwnProperty.call(O,"id")&&F.uint32(10).string(O.id),O.callAction!=null&&Object.hasOwnProperty.call(O,"callAction")&&F.uint32(16).int32(O.callAction),O.callState!=null&&Object.hasOwnProperty.call(O,"callState")&&F.uint32(24).int32(O.callState),O.joinTime!=null&&Object.hasOwnProperty.call(O,"joinTime")&&F.uint32(32).int64(O.joinTime),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],F.uint32(42).fork()).ldelim();return O.permissions!=null&&Object.hasOwnProperty.call(O,"permissions")&&F.uint32(48).int32(O.permissions),O.isPublished!=null&&Object.hasOwnProperty.call(O,"isPublished")&&F.uint32(56).bool(O.isPublished),O.behavior!=null&&Object.hasOwnProperty.call(O,"behavior")&&F.uint32(64).int32(O.behavior),O.channelCache!=null&&Object.hasOwnProperty.call(O,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(O.channelCache,F.uint32(74).fork()).ldelim(),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.User;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.id=O.string();break}case 2:{K.callAction=O.int32();break}case 3:{K.callState=O.int32();break}case 4:{K.joinTime=O.int64();break}case 5:{K.tracks&&K.tracks.length||(K.tracks=[]),K.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}case 6:{K.permissions=O.int32();break}case 7:{K.isPublished=O.bool();break}case 8:{K.behavior=O.int32();break}case 9:{K.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(O,O.uint32());break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.id!=null&&O.hasOwnProperty("id")&&!$util.isString(O.id))return"id: string expected";if(O.callAction!=null&&O.hasOwnProperty("callAction")&&!$util.isInteger(O.callAction))return"callAction: integer expected";if(O.callState!=null&&O.hasOwnProperty("callState")&&!$util.isInteger(O.callState))return"callState: integer expected";if(O.joinTime!=null&&O.hasOwnProperty("joinTime")&&!$util.isInteger(O.joinTime)&&!(O.joinTime&&$util.isInteger(O.joinTime.low)&&$util.isInteger(O.joinTime.high)))return"joinTime: integer|Long expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let F=0;F<O.tracks.length;++F){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[F]);if(z)return"tracks."+z}}if(O.permissions!=null&&O.hasOwnProperty("permissions")&&!$util.isInteger(O.permissions))return"permissions: integer expected";if(O.isPublished!=null&&O.hasOwnProperty("isPublished")&&typeof O.isPublished!="boolean")return"isPublished: boolean expected";if(O.behavior!=null&&O.hasOwnProperty("behavior")&&!$util.isInteger(O.behavior))return"behavior: integer expected";if(O.channelCache!=null&&O.hasOwnProperty("channelCache")){let F=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(O.channelCache);if(F)return"channelCache."+F}return null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.User)return O;let F=new $root.com.quick.voice.proto.User;if(O.id!=null&&(F.id=String(O.id)),O.callAction!=null&&(F.callAction=O.callAction|0),O.callState!=null&&(F.callState=O.callState|0),O.joinTime!=null&&($util.Long?(F.joinTime=$util.Long.fromValue(O.joinTime)).unsigned=!1:typeof O.joinTime=="string"?F.joinTime=parseInt(O.joinTime,10):typeof O.joinTime=="number"?F.joinTime=O.joinTime:typeof O.joinTime=="object"&&(F.joinTime=new $util.LongBits(O.joinTime.low>>>0,O.joinTime.high>>>0).toNumber())),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");F.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");F.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}if(O.permissions!=null&&(F.permissions=O.permissions|0),O.isPublished!=null&&(F.isPublished=!!O.isPublished),O.behavior!=null&&(F.behavior=O.behavior|0),O.channelCache!=null){if(typeof O.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(O.channelCache)}return F},I.toObject=function(O,F){F||(F={});let z={};if((F.arrays||F.defaults)&&(z.tracks=[]),F.defaults&&(z.id=""),O.id!=null&&O.hasOwnProperty("id")&&(z.id=O.id),O.callAction!=null&&O.hasOwnProperty("callAction")&&(z.callAction=O.callAction,F.oneofs&&(z._callAction="callAction")),O.callState!=null&&O.hasOwnProperty("callState")&&(z.callState=O.callState,F.oneofs&&(z._callState="callState")),O.joinTime!=null&&O.hasOwnProperty("joinTime")&&(typeof O.joinTime=="number"?z.joinTime=F.longs===String?String(O.joinTime):O.joinTime:z.joinTime=F.longs===String?$util.Long.prototype.toString.call(O.joinTime):F.longs===Number?new $util.LongBits(O.joinTime.low>>>0,O.joinTime.high>>>0).toNumber():O.joinTime,F.oneofs&&(z._joinTime="joinTime")),O.tracks&&O.tracks.length){z.tracks=[];for(let K=0;K<O.tracks.length;++K)z.tracks[K]=$root.com.quick.voice.proto.Track.toObject(O.tracks[K],F)}return O.permissions!=null&&O.hasOwnProperty("permissions")&&(z.permissions=O.permissions,F.oneofs&&(z._permissions="permissions")),O.isPublished!=null&&O.hasOwnProperty("isPublished")&&(z.isPublished=O.isPublished,F.oneofs&&(z._isPublished="isPublished")),O.behavior!=null&&O.hasOwnProperty("behavior")&&(z.behavior=O.behavior,F.oneofs&&(z._behavior="behavior")),O.channelCache!=null&&O.hasOwnProperty("channelCache")&&(z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(O.channelCache,F),F.oneofs&&(z._channelCache="channelCache")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.User"},I}(),J.DataChannelCacheInfo=function(){function I(D){if(this.channels=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.channels=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.channels!=null&&a.channels.length)for(let F=0;F<a.channels.length;++F)$root.com.quick.voice.proto.DataChannel.encode(a.channels[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.channels&&z.channels.length||(z.channels=[]),z.channels.push($root.com.quick.voice.proto.DataChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.channels!=null&&a.hasOwnProperty("channels")){if(!Array.isArray(a.channels))return"channels: array expected";for(let O=0;O<a.channels.length;++O){let F=$root.com.quick.voice.proto.DataChannel.verify(a.channels[O]);if(F)return"channels."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return a;let O=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(a.channels){if(!Array.isArray(a.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");O.channels=[];for(let F=0;F<a.channels.length;++F){if(typeof a.channels[F]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");O.channels[F]=$root.com.quick.voice.proto.DataChannel.fromObject(a.channels[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.channels=[]),a.channels&&a.channels.length){F.channels=[];for(let z=0;z<a.channels.length;++z)F.channels[z]=$root.com.quick.voice.proto.DataChannel.toObject(a.channels[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.DataChannelCacheInfo"},I}(),J.DataChannel=function(){function I(a){if(a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.dataChannelName="",I.prototype.id=null;let D;return Object.defineProperty(I.prototype,"_id",{get:$util.oneOfGetter(D=["id"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){return F||(F=$Writer.create()),O.dataChannelName!=null&&Object.hasOwnProperty.call(O,"dataChannelName")&&F.uint32(10).string(O.dataChannelName),O.id!=null&&Object.hasOwnProperty.call(O,"id")&&F.uint32(16).int32(O.id),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.DataChannel;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.dataChannelName=O.string();break}case 2:{K.id=O.int32();break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){return typeof O!="object"||O===null?"object expected":O.dataChannelName!=null&&O.hasOwnProperty("dataChannelName")&&!$util.isString(O.dataChannelName)?"dataChannelName: string expected":O.id!=null&&O.hasOwnProperty("id")&&!$util.isInteger(O.id)?"id: integer expected":null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.DataChannel)return O;let F=new $root.com.quick.voice.proto.DataChannel;return O.dataChannelName!=null&&(F.dataChannelName=String(O.dataChannelName)),O.id!=null&&(F.id=O.id|0),F},I.toObject=function(O,F){F||(F={});let z={};return F.defaults&&(z.dataChannelName=""),O.dataChannelName!=null&&O.hasOwnProperty("dataChannelName")&&(z.dataChannelName=O.dataChannelName),O.id!=null&&O.hasOwnProperty("id")&&(z.id=O.id,F.oneofs&&(z._id="id")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.DataChannel"},I}(),J.Login=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.appid="",I.prototype.userId="",I.prototype.sdkToken="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.appid!=null&&Object.hasOwnProperty.call(a,"appid")&&O.uint32(10).string(a.appid),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(18).string(a.userId),a.sdkToken!=null&&Object.hasOwnProperty.call(a,"sdkToken")&&O.uint32(26).string(a.sdkToken),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.Login;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.appid=a.string();break}case 2:{z.userId=a.string();break}case 3:{z.sdkToken=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.appid!=null&&a.hasOwnProperty("appid")&&!$util.isString(a.appid)?"appid: string expected":a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId)?"userId: string expected":a.sdkToken!=null&&a.hasOwnProperty("sdkToken")&&!$util.isString(a.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.Login)return a;let O=new $root.com.quick.voice.proto.Login;return a.appid!=null&&(O.appid=String(a.appid)),a.userId!=null&&(O.userId=String(a.userId)),a.sdkToken!=null&&(O.sdkToken=String(a.sdkToken)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.appid="",F.userId="",F.sdkToken=""),a.appid!=null&&a.hasOwnProperty("appid")&&(F.appid=a.appid),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.sdkToken!=null&&a.hasOwnProperty("sdkToken")&&(F.sdkToken=a.sdkToken),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.Login"},I}(),J.Track=function(){function I(a){if(a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.mid="",I.prototype.trackName=null,I.prototype.location=null,I.prototype.userId=null,I.prototype.code=null,I.prototype.desc=null,I.prototype.type=null,I.prototype.isValid=null,I.prototype.simulcast=null;let D;return Object.defineProperty(I.prototype,"_trackName",{get:$util.oneOfGetter(D=["trackName"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_location",{get:$util.oneOfGetter(D=["location"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_userId",{get:$util.oneOfGetter(D=["userId"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_type",{get:$util.oneOfGetter(D=["type"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_isValid",{get:$util.oneOfGetter(D=["isValid"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_simulcast",{get:$util.oneOfGetter(D=["simulcast"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){return F||(F=$Writer.create()),O.mid!=null&&Object.hasOwnProperty.call(O,"mid")&&F.uint32(10).string(O.mid),O.trackName!=null&&Object.hasOwnProperty.call(O,"trackName")&&F.uint32(18).string(O.trackName),O.location!=null&&Object.hasOwnProperty.call(O,"location")&&F.uint32(26).string(O.location),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&F.uint32(34).string(O.userId),O.code!=null&&Object.hasOwnProperty.call(O,"code")&&F.uint32(40).int32(O.code),O.desc!=null&&Object.hasOwnProperty.call(O,"desc")&&F.uint32(50).string(O.desc),O.type!=null&&Object.hasOwnProperty.call(O,"type")&&F.uint32(56).int32(O.type),O.isValid!=null&&Object.hasOwnProperty.call(O,"isValid")&&F.uint32(64).bool(O.isValid),O.simulcast!=null&&Object.hasOwnProperty.call(O,"simulcast")&&F.uint32(74).string(O.simulcast),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.Track;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.mid=O.string();break}case 2:{K.trackName=O.string();break}case 3:{K.location=O.string();break}case 4:{K.userId=O.string();break}case 5:{K.code=O.int32();break}case 6:{K.desc=O.string();break}case 7:{K.type=O.int32();break}case 8:{K.isValid=O.bool();break}case 9:{K.simulcast=O.string();break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.mid!=null&&O.hasOwnProperty("mid")&&!$util.isString(O.mid))return"mid: string expected";if(O.trackName!=null&&O.hasOwnProperty("trackName")&&!$util.isString(O.trackName))return"trackName: string expected";if(O.location!=null&&O.hasOwnProperty("location")&&!$util.isString(O.location))return"location: string expected";if(O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId))return"userId: string expected";if(O.code!=null&&O.hasOwnProperty("code")&&!$util.isInteger(O.code))return"code: integer expected";if(O.desc!=null&&O.hasOwnProperty("desc")&&!$util.isString(O.desc))return"desc: string expected";if(O.type!=null&&O.hasOwnProperty("type"))switch(O.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return O.isValid!=null&&O.hasOwnProperty("isValid")&&typeof O.isValid!="boolean"?"isValid: boolean expected":O.simulcast!=null&&O.hasOwnProperty("simulcast")&&!$util.isString(O.simulcast)?"simulcast: string expected":null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.Track)return O;let F=new $root.com.quick.voice.proto.Track;switch(O.mid!=null&&(F.mid=String(O.mid)),O.trackName!=null&&(F.trackName=String(O.trackName)),O.location!=null&&(F.location=String(O.location)),O.userId!=null&&(F.userId=String(O.userId)),O.code!=null&&(F.code=O.code|0),O.desc!=null&&(F.desc=String(O.desc)),O.type){default:if(typeof O.type=="number"){F.type=O.type;break}break;case"Microphone":case 0:F.type=0;break;case"Camera":case 1:F.type=1;break;case"Screen":case 2:F.type=2;break;case"SystemVoice":case 3:F.type=3;break}return O.isValid!=null&&(F.isValid=!!O.isValid),O.simulcast!=null&&(F.simulcast=String(O.simulcast)),F},I.toObject=function(O,F){F||(F={});let z={};return F.defaults&&(z.mid=""),O.mid!=null&&O.hasOwnProperty("mid")&&(z.mid=O.mid),O.trackName!=null&&O.hasOwnProperty("trackName")&&(z.trackName=O.trackName,F.oneofs&&(z._trackName="trackName")),O.location!=null&&O.hasOwnProperty("location")&&(z.location=O.location,F.oneofs&&(z._location="location")),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId,F.oneofs&&(z._userId="userId")),O.code!=null&&O.hasOwnProperty("code")&&(z.code=O.code,F.oneofs&&(z._code="code")),O.desc!=null&&O.hasOwnProperty("desc")&&(z.desc=O.desc,F.oneofs&&(z._desc="desc")),O.type!=null&&O.hasOwnProperty("type")&&(z.type=F.enums===String?$root.com.quick.voice.proto.TrackType[O.type]===void 0?O.type:$root.com.quick.voice.proto.TrackType[O.type]:O.type,F.oneofs&&(z._type="type")),O.isValid!=null&&O.hasOwnProperty("isValid")&&(z.isValid=O.isValid,F.oneofs&&(z._isValid="isValid")),O.simulcast!=null&&O.hasOwnProperty("simulcast")&&(z.simulcast=O.simulcast,F.oneofs&&(z._simulcast="simulcast")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.Track"},I}(),J.JoinReq=function(){function I(a){if(a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.callType=0,I.prototype.token=null;let D;return Object.defineProperty(I.prototype,"_token",{get:$util.oneOfGetter(D=["token"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){return F||(F=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&F.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,F.uint32(18).fork()).ldelim(),O.callType!=null&&Object.hasOwnProperty.call(O,"callType")&&F.uint32(24).int32(O.callType),O.token!=null&&Object.hasOwnProperty.call(O,"token")&&F.uint32(34).string(O.token),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.JoinReq;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.roomId=O.string();break}case 2:{K.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}case 3:{K.callType=O.int32();break}case 4:{K.token=O.string();break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let F=$root.com.quick.voice.proto.User.verify(O.user);if(F)return"user."+F}if(O.callType!=null&&O.hasOwnProperty("callType"))switch(O.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return O.token!=null&&O.hasOwnProperty("token")&&!$util.isString(O.token)?"token: string expected":null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.JoinReq)return O;let F=new $root.com.quick.voice.proto.JoinReq;if(O.roomId!=null&&(F.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");F.user=$root.com.quick.voice.proto.User.fromObject(O.user)}switch(O.callType){default:if(typeof O.callType=="number"){F.callType=O.callType;break}break;case"Normal":case 0:F.callType=0;break;case"Meeting":case 1:F.callType=1;break;case"Live":case 2:F.callType=2;break}return O.token!=null&&(F.token=String(O.token)),F},I.toObject=function(O,F){F||(F={});let z={};return F.defaults&&(z.roomId="",z.user=null,z.callType=F.enums===String?"Normal":0),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,F)),O.callType!=null&&O.hasOwnProperty("callType")&&(z.callType=F.enums===String?$root.com.quick.voice.proto.CallType[O.callType]===void 0?O.callType:$root.com.quick.voice.proto.CallType[O.callType]:O.callType),O.token!=null&&O.hasOwnProperty("token")&&(z.token=O.token,F.oneofs&&(z._token="token")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.JoinReq"},I}(),J.JoinRsp=function(){function I(D){if(this.roomUsers=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.roomUsers=$util.emptyArray,I.prototype.callType=0,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.roomUsers!=null&&a.roomUsers.length)for(let F=0;F<a.roomUsers.length;++F)$root.com.quick.voice.proto.User.encode(a.roomUsers[F],O.uint32(18).fork()).ldelim();return a.callType!=null&&Object.hasOwnProperty.call(a,"callType")&&O.uint32(24).int32(a.callType),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.JoinRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.roomUsers&&z.roomUsers.length||(z.roomUsers=[]),z.roomUsers.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}case 3:{z.callType=a.int32();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.roomUsers!=null&&a.hasOwnProperty("roomUsers")){if(!Array.isArray(a.roomUsers))return"roomUsers: array expected";for(let O=0;O<a.roomUsers.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.roomUsers[O]);if(F)return"roomUsers."+F}}if(a.callType!=null&&a.hasOwnProperty("callType"))switch(a.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.JoinRsp)return a;let O=new $root.com.quick.voice.proto.JoinRsp;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.roomUsers){if(!Array.isArray(a.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");O.roomUsers=[];for(let F=0;F<a.roomUsers.length;++F){if(typeof a.roomUsers[F]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");O.roomUsers[F]=$root.com.quick.voice.proto.User.fromObject(a.roomUsers[F])}}switch(a.callType){default:if(typeof a.callType=="number"){O.callType=a.callType;break}break;case"Normal":case 0:O.callType=0;break;case"Meeting":case 1:O.callType=1;break;case"Live":case 2:O.callType=2;break}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.roomUsers=[]),O.defaults&&(F.roomId="",F.callType=O.enums===String?"Normal":0),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.roomUsers&&a.roomUsers.length){F.roomUsers=[];for(let z=0;z<a.roomUsers.length;++z)F.roomUsers[z]=$root.com.quick.voice.proto.User.toObject(a.roomUsers[z],O)}return a.callType!=null&&a.hasOwnProperty("callType")&&(F.callType=O.enums===String?$root.com.quick.voice.proto.CallType[a.callType]===void 0?a.callType:$root.com.quick.voice.proto.CallType[a.callType]:a.callType),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.JoinRsp"},I}(),J.JoinNotify=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(18).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.JoinNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.JoinNotify)return a;let O=new $root.com.quick.voice.proto.JoinNotify;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.JoinNotify"},I}(),J.ConnectCFReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.sdp="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.sdp!=null&&Object.hasOwnProperty.call(a,"sdp")&&O.uint32(10).string(a.sdp),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ConnectCFReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.sdp=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.sdp!=null&&a.hasOwnProperty("sdp")&&!$util.isString(a.sdp)?"sdp: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ConnectCFReq)return a;let O=new $root.com.quick.voice.proto.ConnectCFReq;return a.sdp!=null&&(O.sdp=String(a.sdp)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.sdp=""),a.sdp!=null&&a.hasOwnProperty("sdp")&&(F.sdp=a.sdp),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ConnectCFReq"},I}(),J.ConnectCFRsp=function(){function I(D){if(this.subscribeUsers=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.remoteSdp="",I.prototype.subscribeUsers=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.remoteSdp!=null&&Object.hasOwnProperty.call(a,"remoteSdp")&&O.uint32(10).string(a.remoteSdp),a.subscribeUsers!=null&&a.subscribeUsers.length)for(let F=0;F<a.subscribeUsers.length;++F)$root.com.quick.voice.proto.User.encode(a.subscribeUsers[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ConnectCFRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.remoteSdp=a.string();break}case 2:{z.subscribeUsers&&z.subscribeUsers.length||(z.subscribeUsers=[]),z.subscribeUsers.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&!$util.isString(a.remoteSdp))return"remoteSdp: string expected";if(a.subscribeUsers!=null&&a.hasOwnProperty("subscribeUsers")){if(!Array.isArray(a.subscribeUsers))return"subscribeUsers: array expected";for(let O=0;O<a.subscribeUsers.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.subscribeUsers[O]);if(F)return"subscribeUsers."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ConnectCFRsp)return a;let O=new $root.com.quick.voice.proto.ConnectCFRsp;if(a.remoteSdp!=null&&(O.remoteSdp=String(a.remoteSdp)),a.subscribeUsers){if(!Array.isArray(a.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");O.subscribeUsers=[];for(let F=0;F<a.subscribeUsers.length;++F){if(typeof a.subscribeUsers[F]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");O.subscribeUsers[F]=$root.com.quick.voice.proto.User.fromObject(a.subscribeUsers[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.subscribeUsers=[]),O.defaults&&(F.remoteSdp=""),a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&(F.remoteSdp=a.remoteSdp),a.subscribeUsers&&a.subscribeUsers.length){F.subscribeUsers=[];for(let z=0;z<a.subscribeUsers.length;++z)F.subscribeUsers[z]=$root.com.quick.voice.proto.User.toObject(a.subscribeUsers[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ConnectCFRsp"},I}(),J.PublishReq=function(){function I(a){if(this.tracks=[],a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.callAction=0,I.prototype.recreate=null;let D;return Object.defineProperty(I.prototype,"_recreate",{get:$util.oneOfGetter(D=["recreate"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){if(F||(F=$Writer.create()),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&F.uint32(10).string(O.sdp),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],F.uint32(18).fork()).ldelim();return O.callAction!=null&&Object.hasOwnProperty.call(O,"callAction")&&F.uint32(24).int32(O.callAction),O.recreate!=null&&Object.hasOwnProperty.call(O,"recreate")&&F.uint32(32).bool(O.recreate),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.PublishReq;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.sdp=O.string();break}case 2:{K.tracks&&K.tracks.length||(K.tracks=[]),K.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}case 3:{K.callAction=O.int32();break}case 4:{K.recreate=O.bool();break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp))return"sdp: string expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let F=0;F<O.tracks.length;++F){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[F]);if(z)return"tracks."+z}}return O.callAction!=null&&O.hasOwnProperty("callAction")&&!$util.isInteger(O.callAction)?"callAction: integer expected":O.recreate!=null&&O.hasOwnProperty("recreate")&&typeof O.recreate!="boolean"?"recreate: boolean expected":null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PublishReq)return O;let F=new $root.com.quick.voice.proto.PublishReq;if(O.sdp!=null&&(F.sdp=String(O.sdp)),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");F.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");F.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}return O.callAction!=null&&(F.callAction=O.callAction|0),O.recreate!=null&&(F.recreate=!!O.recreate),F},I.toObject=function(O,F){F||(F={});let z={};if((F.arrays||F.defaults)&&(z.tracks=[]),F.defaults&&(z.sdp="",z.callAction=0),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),O.tracks&&O.tracks.length){z.tracks=[];for(let K=0;K<O.tracks.length;++K)z.tracks[K]=$root.com.quick.voice.proto.Track.toObject(O.tracks[K],F)}return O.callAction!=null&&O.hasOwnProperty("callAction")&&(z.callAction=O.callAction),O.recreate!=null&&O.hasOwnProperty("recreate")&&(z.recreate=O.recreate,F.oneofs&&(z._recreate="recreate")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PublishReq"},I}(),J.PublishRsp=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.remoteSdp="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.remoteSdp!=null&&Object.hasOwnProperty.call(a,"remoteSdp")&&O.uint32(10).string(a.remoteSdp),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.PublishRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.remoteSdp=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&!$util.isString(a.remoteSdp)?"remoteSdp: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PublishRsp)return a;let O=new $root.com.quick.voice.proto.PublishRsp;return a.remoteSdp!=null&&(O.remoteSdp=String(a.remoteSdp)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.remoteSdp=""),a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&(F.remoteSdp=a.remoteSdp),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PublishRsp"},I}(),J.PublishNotify=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(18).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.PublishNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PublishNotify)return a;let O=new $root.com.quick.voice.proto.PublishNotify;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PublishNotify"},I}(),J.SubscribeReq=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.users=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.User.encode(a.users[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.SubscribeReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.users[O]);if(F)return"users."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.SubscribeReq)return a;let O=new $root.com.quick.voice.proto.SubscribeReq;if(a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");O.users[F]=$root.com.quick.voice.proto.User.fromObject(a.users[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.User.toObject(a.users[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.SubscribeReq"},I}(),J.SubscribeRsp=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.remoteSdp="",I.prototype.users=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.remoteSdp!=null&&Object.hasOwnProperty.call(a,"remoteSdp")&&O.uint32(10).string(a.remoteSdp),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.User.encode(a.users[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.SubscribeRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.remoteSdp=a.string();break}case 2:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&!$util.isString(a.remoteSdp))return"remoteSdp: string expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.users[O]);if(F)return"users."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.SubscribeRsp)return a;let O=new $root.com.quick.voice.proto.SubscribeRsp;if(a.remoteSdp!=null&&(O.remoteSdp=String(a.remoteSdp)),a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");O.users[F]=$root.com.quick.voice.proto.User.fromObject(a.users[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),O.defaults&&(F.remoteSdp=""),a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&(F.remoteSdp=a.remoteSdp),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.User.toObject(a.users[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.SubscribeRsp"},I}(),J.RenegotiateReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.userId="",I.prototype.sdp="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(10).string(a.userId),a.sdp!=null&&Object.hasOwnProperty.call(a,"sdp")&&O.uint32(18).string(a.sdp),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.RenegotiateReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.userId=a.string();break}case 2:{z.sdp=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId)?"userId: string expected":a.sdp!=null&&a.hasOwnProperty("sdp")&&!$util.isString(a.sdp)?"sdp: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.RenegotiateReq)return a;let O=new $root.com.quick.voice.proto.RenegotiateReq;return a.userId!=null&&(O.userId=String(a.userId)),a.sdp!=null&&(O.sdp=String(a.sdp)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.userId="",F.sdp=""),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.sdp!=null&&a.hasOwnProperty("sdp")&&(F.sdp=a.sdp),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.RenegotiateReq"},I}(),J.QuitReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.userId="",I.prototype.roomId="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(10).string(a.userId),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(18).string(a.roomId),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.QuitReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.userId=a.string();break}case 2:{z.roomId=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId)?"userId: string expected":a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.QuitReq)return a;let O=new $root.com.quick.voice.proto.QuitReq;return a.userId!=null&&(O.userId=String(a.userId)),a.roomId!=null&&(O.roomId=String(a.roomId)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.userId="",F.roomId=""),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.QuitReq"},I}(),J.QuitNotify=function(){function I(a){if(a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.code=null,I.prototype.desc=null;let D;return Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(D=["code"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(D=["desc"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){return F||(F=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&F.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,F.uint32(18).fork()).ldelim(),O.code!=null&&Object.hasOwnProperty.call(O,"code")&&F.uint32(24).int32(O.code),O.desc!=null&&Object.hasOwnProperty.call(O,"desc")&&F.uint32(34).string(O.desc),F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.QuitNotify;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.roomId=O.string();break}case 2:{K.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}case 3:{K.code=O.int32();break}case 4:{K.desc=O.string();break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let F=$root.com.quick.voice.proto.User.verify(O.user);if(F)return"user."+F}return O.code!=null&&O.hasOwnProperty("code")&&!$util.isInteger(O.code)?"code: integer expected":O.desc!=null&&O.hasOwnProperty("desc")&&!$util.isString(O.desc)?"desc: string expected":null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.QuitNotify)return O;let F=new $root.com.quick.voice.proto.QuitNotify;if(O.roomId!=null&&(F.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");F.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return O.code!=null&&(F.code=O.code|0),O.desc!=null&&(F.desc=String(O.desc)),F},I.toObject=function(O,F){F||(F={});let z={};return F.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,F)),O.code!=null&&O.hasOwnProperty("code")&&(z.code=O.code,F.oneofs&&(z._code="code")),O.desc!=null&&O.hasOwnProperty("desc")&&(z.desc=O.desc,F.oneofs&&(z._desc="desc")),z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.QuitNotify"},I}(),J.TokenExpireNotify=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.TokenExpireNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.TokenExpireNotify)return a;let O=new $root.com.quick.voice.proto.TokenExpireNotify;return a.roomId!=null&&(O.roomId=String(a.roomId)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.TokenExpireNotify"},I}(),J.UpdateTokenReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.sdkToken="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.sdkToken!=null&&Object.hasOwnProperty.call(a,"sdkToken")&&O.uint32(18).string(a.sdkToken),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UpdateTokenReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.sdkToken=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":a.sdkToken!=null&&a.hasOwnProperty("sdkToken")&&!$util.isString(a.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UpdateTokenReq)return a;let O=new $root.com.quick.voice.proto.UpdateTokenReq;return a.roomId!=null&&(O.roomId=String(a.roomId)),a.sdkToken!=null&&(O.sdkToken=String(a.sdkToken)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.sdkToken=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.sdkToken!=null&&a.hasOwnProperty("sdkToken")&&(F.sdkToken=a.sdkToken),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UpdateTokenReq"},I}(),J.NetQualityChange=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.userId="",I.prototype.roomId="",I.prototype.egress=0,I.prototype.ingress=0,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(10).string(a.userId),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(18).string(a.roomId),a.egress!=null&&Object.hasOwnProperty.call(a,"egress")&&O.uint32(24).int32(a.egress),a.ingress!=null&&Object.hasOwnProperty.call(a,"ingress")&&O.uint32(32).int32(a.ingress),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.NetQualityChange;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.userId=a.string();break}case 2:{z.roomId=a.string();break}case 3:{z.egress=a.int32();break}case 4:{z.ingress=a.int32();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId)?"userId: string expected":a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":a.egress!=null&&a.hasOwnProperty("egress")&&!$util.isInteger(a.egress)?"egress: integer expected":a.ingress!=null&&a.hasOwnProperty("ingress")&&!$util.isInteger(a.ingress)?"ingress: integer expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.NetQualityChange)return a;let O=new $root.com.quick.voice.proto.NetQualityChange;return a.userId!=null&&(O.userId=String(a.userId)),a.roomId!=null&&(O.roomId=String(a.roomId)),a.egress!=null&&(O.egress=a.egress|0),a.ingress!=null&&(O.ingress=a.ingress|0),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.userId="",F.roomId="",F.egress=0,F.ingress=0),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.egress!=null&&a.hasOwnProperty("egress")&&(F.egress=a.egress),a.ingress!=null&&a.hasOwnProperty("ingress")&&(F.ingress=a.ingress),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.NetQualityChange"},I}(),J.NetQualityNotify=function(){function I(D){if(this.qualities=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.qualities=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.qualities!=null&&a.qualities.length)for(let F=0;F<a.qualities.length;++F)$root.com.quick.voice.proto.NetQualityChange.encode(a.qualities[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.NetQualityNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.qualities&&z.qualities.length||(z.qualities=[]),z.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.qualities!=null&&a.hasOwnProperty("qualities")){if(!Array.isArray(a.qualities))return"qualities: array expected";for(let O=0;O<a.qualities.length;++O){let F=$root.com.quick.voice.proto.NetQualityChange.verify(a.qualities[O]);if(F)return"qualities."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.NetQualityNotify)return a;let O=new $root.com.quick.voice.proto.NetQualityNotify;if(a.qualities){if(!Array.isArray(a.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");O.qualities=[];for(let F=0;F<a.qualities.length;++F){if(typeof a.qualities[F]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");O.qualities[F]=$root.com.quick.voice.proto.NetQualityChange.fromObject(a.qualities[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.qualities=[]),a.qualities&&a.qualities.length){F.qualities=[];for(let z=0;z<a.qualities.length;++z)F.qualities[z]=$root.com.quick.voice.proto.NetQualityChange.toObject(a.qualities[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.NetQualityNotify"},I}(),J.UpdateCall=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(18).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UpdateCall;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UpdateCall)return a;let O=new $root.com.quick.voice.proto.UpdateCall;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UpdateCall"},I}(),J.SyncRoomInfoReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(18).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return a;let O=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.SyncRoomInfoReq"},I}(),J.SyncRoomInfoRsp=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.isValid=!1,I.prototype.users=$util.emptyArray,I.prototype.isActive=!1,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.isValid!=null&&Object.hasOwnProperty.call(a,"isValid")&&O.uint32(16).bool(a.isValid),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.User.encode(a.users[F],O.uint32(26).fork()).ldelim();return a.isActive!=null&&Object.hasOwnProperty.call(a,"isActive")&&O.uint32(32).bool(a.isActive),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.isValid=a.bool();break}case 3:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}case 4:{z.isActive=a.bool();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.isValid!=null&&a.hasOwnProperty("isValid")&&typeof a.isValid!="boolean")return"isValid: boolean expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.users[O]);if(F)return"users."+F}}return a.isActive!=null&&a.hasOwnProperty("isActive")&&typeof a.isActive!="boolean"?"isActive: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return a;let O=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.isValid!=null&&(O.isValid=!!a.isValid),a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");O.users[F]=$root.com.quick.voice.proto.User.fromObject(a.users[F])}}return a.isActive!=null&&(O.isActive=!!a.isActive),O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),O.defaults&&(F.roomId="",F.isValid=!1,F.isActive=!1),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.isValid!=null&&a.hasOwnProperty("isValid")&&(F.isValid=a.isValid),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.User.toObject(a.users[z],O)}return a.isActive!=null&&a.hasOwnProperty("isActive")&&(F.isActive=a.isActive),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.SyncRoomInfoRsp"},I}(),J.UpdateTime=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.time!=null&&Object.hasOwnProperty.call(a,"time")&&O.uint32(8).int64(a.time),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UpdateTime;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.time=a.int64();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.time!=null&&a.hasOwnProperty("time")&&!$util.isInteger(a.time)&&!(a.time&&$util.isInteger(a.time.low)&&$util.isInteger(a.time.high))?"time: integer|Long expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UpdateTime)return a;let O=new $root.com.quick.voice.proto.UpdateTime;return a.time!=null&&($util.Long?(O.time=$util.Long.fromValue(a.time)).unsigned=!1:typeof a.time=="string"?O.time=parseInt(a.time,10):typeof a.time=="number"?O.time=a.time:typeof a.time=="object"&&(O.time=new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber())),O},I.toObject=function(a,O){O||(O={});let F={};if(O.defaults)if($util.Long){let z=new $util.Long(0,0,!1);F.time=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.time=O.longs===String?"0":0;return a.time!=null&&a.hasOwnProperty("time")&&(typeof a.time=="number"?F.time=O.longs===String?String(a.time):a.time:F.time=O.longs===String?$util.Long.prototype.toString.call(a.time):O.longs===Number?new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber():a.time),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UpdateTime"},I}(),J.CloseTrackReq=function(){function I(D){if(this.tracks=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.roomId="",I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.sdp!=null&&Object.hasOwnProperty.call(a,"sdp")&&O.uint32(10).string(a.sdp),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],O.uint32(18).fork()).ldelim();return a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(26).string(a.roomId),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.CloseTrackReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.sdp=a.string();break}case 2:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}case 3:{z.roomId=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.sdp!=null&&a.hasOwnProperty("sdp")&&!$util.isString(a.sdp))return"sdp: string expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let O=0;O<a.tracks.length;++O){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[O]);if(F)return"tracks."+F}}return a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CloseTrackReq)return a;let O=new $root.com.quick.voice.proto.CloseTrackReq;if(a.sdp!=null&&(O.sdp=String(a.sdp)),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");O.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");O.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}return a.roomId!=null&&(O.roomId=String(a.roomId)),O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.tracks=[]),O.defaults&&(F.sdp="",F.roomId=""),a.sdp!=null&&a.hasOwnProperty("sdp")&&(F.sdp=a.sdp),a.tracks&&a.tracks.length){F.tracks=[];for(let z=0;z<a.tracks.length;++z)F.tracks[z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[z],O)}return a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CloseTrackReq"},I}(),J.CloseTrackRsp=function(){function I(D){if(this.tracks=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.remoteSdp="",I.prototype.tracks=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.remoteSdp!=null&&Object.hasOwnProperty.call(a,"remoteSdp")&&O.uint32(10).string(a.remoteSdp),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.CloseTrackRsp;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.remoteSdp=a.string();break}case 2:{z.tracks&&z.tracks.length||(z.tracks=[]),z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&!$util.isString(a.remoteSdp))return"remoteSdp: string expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let O=0;O<a.tracks.length;++O){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[O]);if(F)return"tracks."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CloseTrackRsp)return a;let O=new $root.com.quick.voice.proto.CloseTrackRsp;if(a.remoteSdp!=null&&(O.remoteSdp=String(a.remoteSdp)),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");O.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");O.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.tracks=[]),O.defaults&&(F.remoteSdp=""),a.remoteSdp!=null&&a.hasOwnProperty("remoteSdp")&&(F.remoteSdp=a.remoteSdp),a.tracks&&a.tracks.length){F.tracks=[];for(let z=0;z<a.tracks.length;++z)F.tracks[z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CloseTrackRsp"},I}(),J.CloseTrackNotify=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(10).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.CloseTrackNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CloseTrackNotify)return a;let O=new $root.com.quick.voice.proto.CloseTrackNotify;if(a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.user=null),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CloseTrackNotify"},I}(),J.ToggleLiveRoomReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId)?"roomId: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return a;let O=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return a.roomId!=null&&(O.roomId=String(a.roomId)),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ToggleLiveRoomReq"},I}(),J.ToggleLiveRoomRsq=function(){function I(D){if(this.roomUsers=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.hash="",I.prototype.roomUsers=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.hash!=null&&Object.hasOwnProperty.call(a,"hash")&&O.uint32(18).string(a.hash),a.roomUsers!=null&&a.roomUsers.length)for(let F=0;F<a.roomUsers.length;++F)$root.com.quick.voice.proto.User.encode(a.roomUsers[F],O.uint32(26).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.hash=a.string();break}case 3:{z.roomUsers&&z.roomUsers.length||(z.roomUsers=[]),z.roomUsers.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.hash!=null&&a.hasOwnProperty("hash")&&!$util.isString(a.hash))return"hash: string expected";if(a.roomUsers!=null&&a.hasOwnProperty("roomUsers")){if(!Array.isArray(a.roomUsers))return"roomUsers: array expected";for(let O=0;O<a.roomUsers.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.roomUsers[O]);if(F)return"roomUsers."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return a;let O=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.hash!=null&&(O.hash=String(a.hash)),a.roomUsers){if(!Array.isArray(a.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");O.roomUsers=[];for(let F=0;F<a.roomUsers.length;++F){if(typeof a.roomUsers[F]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");O.roomUsers[F]=$root.com.quick.voice.proto.User.fromObject(a.roomUsers[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.roomUsers=[]),O.defaults&&(F.roomId="",F.hash=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.hash!=null&&a.hasOwnProperty("hash")&&(F.hash=a.hash),a.roomUsers&&a.roomUsers.length){F.roomUsers=[];for(let z=0;z<a.roomUsers.length;++z)F.roomUsers[z]=$root.com.quick.voice.proto.User.toObject(a.roomUsers[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ToggleLiveRoomRsq"},I}(),J.TrackType=function(){const I={},D=Object.create(I);return D[I[0]="Microphone"]=0,D[I[1]="Camera"]=1,D[I[2]="Screen"]=2,D[I[3]="SystemVoice"]=3,D}(),J.ReportInfoReq=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.actionEvent="",I.prototype.userId="",I.prototype.platform="",I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.actionData="",I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.actionEvent!=null&&Object.hasOwnProperty.call(a,"actionEvent")&&O.uint32(10).string(a.actionEvent),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(18).string(a.userId),a.platform!=null&&Object.hasOwnProperty.call(a,"platform")&&O.uint32(26).string(a.platform),a.time!=null&&Object.hasOwnProperty.call(a,"time")&&O.uint32(32).int64(a.time),a.actionData!=null&&Object.hasOwnProperty.call(a,"actionData")&&O.uint32(42).string(a.actionData),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ReportInfoReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.actionEvent=a.string();break}case 2:{z.userId=a.string();break}case 3:{z.platform=a.string();break}case 4:{z.time=a.int64();break}case 5:{z.actionData=a.string();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.actionEvent!=null&&a.hasOwnProperty("actionEvent")&&!$util.isString(a.actionEvent)?"actionEvent: string expected":a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId)?"userId: string expected":a.platform!=null&&a.hasOwnProperty("platform")&&!$util.isString(a.platform)?"platform: string expected":a.time!=null&&a.hasOwnProperty("time")&&!$util.isInteger(a.time)&&!(a.time&&$util.isInteger(a.time.low)&&$util.isInteger(a.time.high))?"time: integer|Long expected":a.actionData!=null&&a.hasOwnProperty("actionData")&&!$util.isString(a.actionData)?"actionData: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ReportInfoReq)return a;let O=new $root.com.quick.voice.proto.ReportInfoReq;return a.actionEvent!=null&&(O.actionEvent=String(a.actionEvent)),a.userId!=null&&(O.userId=String(a.userId)),a.platform!=null&&(O.platform=String(a.platform)),a.time!=null&&($util.Long?(O.time=$util.Long.fromValue(a.time)).unsigned=!1:typeof a.time=="string"?O.time=parseInt(a.time,10):typeof a.time=="number"?O.time=a.time:typeof a.time=="object"&&(O.time=new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber())),a.actionData!=null&&(O.actionData=String(a.actionData)),O},I.toObject=function(a,O){O||(O={});let F={};if(O.defaults){if(F.actionEvent="",F.userId="",F.platform="",$util.Long){let z=new $util.Long(0,0,!1);F.time=O.longs===String?z.toString():O.longs===Number?z.toNumber():z}else F.time=O.longs===String?"0":0;F.actionData=""}return a.actionEvent!=null&&a.hasOwnProperty("actionEvent")&&(F.actionEvent=a.actionEvent),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.platform!=null&&a.hasOwnProperty("platform")&&(F.platform=a.platform),a.time!=null&&a.hasOwnProperty("time")&&(typeof a.time=="number"?F.time=O.longs===String?String(a.time):a.time:F.time=O.longs===String?$util.Long.prototype.toString.call(a.time):O.longs===Number?new $util.LongBits(a.time.low>>>0,a.time.high>>>0).toNumber():a.time),a.actionData!=null&&a.hasOwnProperty("actionData")&&(F.actionData=a.actionData),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ReportInfoReq"},I}(),J.UpdatePermissions=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,O.uint32(18).fork()).ldelim(),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UpdatePermissions;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let O=$root.com.quick.voice.proto.User.verify(a.user);if(O)return"user."+O}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UpdatePermissions)return a;let O=new $root.com.quick.voice.proto.UpdatePermissions;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");O.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,O)),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UpdatePermissions"},I}(),J.CallType=function(){const I={},D=Object.create(I);return D[I[0]="Normal"]=0,D[I[1]="Meeting"]=1,D[I[2]="Live"]=2,D}(),J.QuitNotifyCode=function(){const I={},D=Object.create(I);return D[I[0]="NormalQuit"]=0,D[I[2021]="Timeout"]=2021,D[I[2011]="TokenExpired"]=2011,D[I[2022]="KickOut"]=2022,D[I[2023]="EndPk"]=2023,D[I[2024]="EndLive"]=2024,D}(),J.UserBehavior=function(){function I(D){if(D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.type=0,I.prototype.behavior=!1,I.create=function(a){return new I(a)},I.encode=function(a,O){return O||(O=$Writer.create()),a.type!=null&&Object.hasOwnProperty.call(a,"type")&&O.uint32(8).int32(a.type),a.behavior!=null&&Object.hasOwnProperty.call(a,"behavior")&&O.uint32(16).bool(a.behavior),O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UserBehavior;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.type=a.int32();break}case 2:{z.behavior=a.bool();break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.type!=null&&a.hasOwnProperty("type"))switch(a.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return a.behavior!=null&&a.hasOwnProperty("behavior")&&typeof a.behavior!="boolean"?"behavior: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UserBehavior)return a;let O=new $root.com.quick.voice.proto.UserBehavior;switch(a.type){default:if(typeof a.type=="number"){O.type=a.type;break}break;case"Microphone":case 0:O.type=0;break;case"Camera":case 1:O.type=1;break;case"Screen":case 2:O.type=2;break;case"SystemVoice":case 3:O.type=3;break}return a.behavior!=null&&(O.behavior=!!a.behavior),O},I.toObject=function(a,O){O||(O={});let F={};return O.defaults&&(F.type=O.enums===String?"Microphone":0,F.behavior=!1),a.type!=null&&a.hasOwnProperty("type")&&(F.type=O.enums===String?$root.com.quick.voice.proto.TrackType[a.type]===void 0?a.type:$root.com.quick.voice.proto.TrackType[a.type]:a.type),a.behavior!=null&&a.hasOwnProperty("behavior")&&(F.behavior=a.behavior),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UserBehavior"},I}(),J.PreventUser=function(){function I(D){if(this.behaviors=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.id="",I.prototype.behaviors=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.id!=null&&Object.hasOwnProperty.call(a,"id")&&O.uint32(10).string(a.id),a.behaviors!=null&&a.behaviors.length)for(let F=0;F<a.behaviors.length;++F)$root.com.quick.voice.proto.UserBehavior.encode(a.behaviors[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.PreventUser;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.id=a.string();break}case 2:{z.behaviors&&z.behaviors.length||(z.behaviors=[]),z.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.id!=null&&a.hasOwnProperty("id")&&!$util.isString(a.id))return"id: string expected";if(a.behaviors!=null&&a.hasOwnProperty("behaviors")){if(!Array.isArray(a.behaviors))return"behaviors: array expected";for(let O=0;O<a.behaviors.length;++O){let F=$root.com.quick.voice.proto.UserBehavior.verify(a.behaviors[O]);if(F)return"behaviors."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PreventUser)return a;let O=new $root.com.quick.voice.proto.PreventUser;if(a.id!=null&&(O.id=String(a.id)),a.behaviors){if(!Array.isArray(a.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");O.behaviors=[];for(let F=0;F<a.behaviors.length;++F){if(typeof a.behaviors[F]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");O.behaviors[F]=$root.com.quick.voice.proto.UserBehavior.fromObject(a.behaviors[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.behaviors=[]),O.defaults&&(F.id=""),a.id!=null&&a.hasOwnProperty("id")&&(F.id=a.id),a.behaviors&&a.behaviors.length){F.behaviors=[];for(let z=0;z<a.behaviors.length;++z)F.behaviors[z]=$root.com.quick.voice.proto.UserBehavior.toObject(a.behaviors[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PreventUser"},I}(),J.PreventUsersBehaviorReq=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.PreventUser.encode(a.users[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.PreventUser.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.PreventUser.verify(a.users[O]);if(F)return"users."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return a;let O=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");O.users[F]=$root.com.quick.voice.proto.PreventUser.fromObject(a.users[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),O.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.PreventUser.toObject(a.users[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PreventUsersBehaviorReq"},I}(),J.PreventUsersBehaviorNotify=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&O.uint32(10).string(a.roomId),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.User.encode(a.users[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.roomId=a.string();break}case 2:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.User.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.User.verify(a.users[O]);if(F)return"users."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return a;let O=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(a.roomId!=null&&(O.roomId=String(a.roomId)),a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");O.users[F]=$root.com.quick.voice.proto.User.fromObject(a.users[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),O.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.User.toObject(a.users[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},I}(),J.AccelerationAreas=function(){const I={},D=Object.create(I);return D[I[0]="chinaMainland"]=0,D[I[1]="global"]=1,D[I[2]="overseas"]=2,D}(),J.CountMethods=function(){const I={},D=Object.create(I);return D[I[0]="flow"]=0,D[I[1]="minutes"]=1,D}(),J.BaseCDNAddress=function(){function I(D){if(this.urlMap={},D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.area=0,I.prototype.countType=0,I.prototype.urlMap=$util.emptyObject,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.area!=null&&Object.hasOwnProperty.call(a,"area")&&O.uint32(8).int32(a.area),a.countType!=null&&Object.hasOwnProperty.call(a,"countType")&&O.uint32(16).int32(a.countType),a.urlMap!=null&&Object.hasOwnProperty.call(a,"urlMap"))for(let F=Object.keys(a.urlMap),z=0;z<F.length;++z)O.uint32(26).fork().uint32(10).string(F[z]).uint32(18).string(a.urlMap[F[z]]).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.BaseCDNAddress,K,te;for(;a.pos<F;){let ne=a.uint32();switch(ne>>>3){case 1:{z.area=a.int32();break}case 2:{z.countType=a.int32();break}case 3:{z.urlMap===$util.emptyObject&&(z.urlMap={});let ee=a.uint32()+a.pos;for(K="",te="";a.pos<ee;){let re=a.uint32();switch(re>>>3){case 1:K=a.string();break;case 2:te=a.string();break;default:a.skipType(re&7);break}}z.urlMap[K]=te;break}default:a.skipType(ne&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.area!=null&&a.hasOwnProperty("area"))switch(a.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(a.countType!=null&&a.hasOwnProperty("countType"))switch(a.countType){default:return"countType: enum value expected";case 0:case 1:break}if(a.urlMap!=null&&a.hasOwnProperty("urlMap")){if(!$util.isObject(a.urlMap))return"urlMap: object expected";let O=Object.keys(a.urlMap);for(let F=0;F<O.length;++F)if(!$util.isString(a.urlMap[O[F]]))return"urlMap: string{k:string} expected"}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.BaseCDNAddress)return a;let O=new $root.com.quick.voice.proto.BaseCDNAddress;switch(a.area){default:if(typeof a.area=="number"){O.area=a.area;break}break;case"chinaMainland":case 0:O.area=0;break;case"global":case 1:O.area=1;break;case"overseas":case 2:O.area=2;break}switch(a.countType){default:if(typeof a.countType=="number"){O.countType=a.countType;break}break;case"flow":case 0:O.countType=0;break;case"minutes":case 1:O.countType=1;break}if(a.urlMap){if(typeof a.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");O.urlMap={};for(let F=Object.keys(a.urlMap),z=0;z<F.length;++z)O.urlMap[F[z]]=String(a.urlMap[F[z]])}return O},I.toObject=function(a,O){O||(O={});let F={};(O.objects||O.defaults)&&(F.urlMap={}),O.defaults&&(F.area=O.enums===String?"chinaMainland":0,F.countType=O.enums===String?"flow":0),a.area!=null&&a.hasOwnProperty("area")&&(F.area=O.enums===String?$root.com.quick.voice.proto.AccelerationAreas[a.area]===void 0?a.area:$root.com.quick.voice.proto.AccelerationAreas[a.area]:a.area),a.countType!=null&&a.hasOwnProperty("countType")&&(F.countType=O.enums===String?$root.com.quick.voice.proto.CountMethods[a.countType]===void 0?a.countType:$root.com.quick.voice.proto.CountMethods[a.countType]:a.countType);let z;if(a.urlMap&&(z=Object.keys(a.urlMap)).length){F.urlMap={};for(let K=0;K<z.length;++K)F.urlMap[z[K]]=a.urlMap[z[K]]}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.BaseCDNAddress"},I}(),J.CDNPlayAddressNotify=function(){function I(a){if(this.standLines=[],a)for(let O=Object.keys(a),F=0;F<O.length;++F)a[O[F]]!=null&&(this[O[F]]=a[O[F]])}I.prototype.roomId="",I.prototype.m3u8=null,I.prototype.rtmp=null,I.prototype.flv=null,I.prototype.rtmps=null,I.prototype.mainLine=null,I.prototype.standLines=$util.emptyArray;let D;return Object.defineProperty(I.prototype,"_m3u8",{get:$util.oneOfGetter(D=["m3u8"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_rtmp",{get:$util.oneOfGetter(D=["rtmp"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_flv",{get:$util.oneOfGetter(D=["flv"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_rtmps",{get:$util.oneOfGetter(D=["rtmps"]),set:$util.oneOfSetter(D)}),Object.defineProperty(I.prototype,"_mainLine",{get:$util.oneOfGetter(D=["mainLine"]),set:$util.oneOfSetter(D)}),I.create=function(O){return new I(O)},I.encode=function(O,F){if(F||(F=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&F.uint32(10).string(O.roomId),O.m3u8!=null&&Object.hasOwnProperty.call(O,"m3u8")&&F.uint32(18).string(O.m3u8),O.rtmp!=null&&Object.hasOwnProperty.call(O,"rtmp")&&F.uint32(26).string(O.rtmp),O.flv!=null&&Object.hasOwnProperty.call(O,"flv")&&F.uint32(34).string(O.flv),O.rtmps!=null&&Object.hasOwnProperty.call(O,"rtmps")&&F.uint32(42).string(O.rtmps),O.mainLine!=null&&Object.hasOwnProperty.call(O,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(O.mainLine,F.uint32(50).fork()).ldelim(),O.standLines!=null&&O.standLines.length)for(let z=0;z<O.standLines.length;++z)$root.com.quick.voice.proto.BaseCDNAddress.encode(O.standLines[z],F.uint32(58).fork()).ldelim();return F},I.encodeDelimited=function(O,F){return this.encode(O,F).ldelim()},I.decode=function(O,F){O instanceof $Reader||(O=$Reader.create(O));let z=F===void 0?O.len:O.pos+F,K=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;O.pos<z;){let te=O.uint32();switch(te>>>3){case 1:{K.roomId=O.string();break}case 2:{K.m3u8=O.string();break}case 3:{K.rtmp=O.string();break}case 4:{K.flv=O.string();break}case 5:{K.rtmps=O.string();break}case 6:{K.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(O,O.uint32());break}case 7:{K.standLines&&K.standLines.length||(K.standLines=[]),K.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(O,O.uint32()));break}default:O.skipType(te&7);break}}return K},I.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},I.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.m3u8!=null&&O.hasOwnProperty("m3u8")&&!$util.isString(O.m3u8))return"m3u8: string expected";if(O.rtmp!=null&&O.hasOwnProperty("rtmp")&&!$util.isString(O.rtmp))return"rtmp: string expected";if(O.flv!=null&&O.hasOwnProperty("flv")&&!$util.isString(O.flv))return"flv: string expected";if(O.rtmps!=null&&O.hasOwnProperty("rtmps")&&!$util.isString(O.rtmps))return"rtmps: string expected";if(O.mainLine!=null&&O.hasOwnProperty("mainLine")){let F=$root.com.quick.voice.proto.BaseCDNAddress.verify(O.mainLine);if(F)return"mainLine."+F}if(O.standLines!=null&&O.hasOwnProperty("standLines")){if(!Array.isArray(O.standLines))return"standLines: array expected";for(let F=0;F<O.standLines.length;++F){let z=$root.com.quick.voice.proto.BaseCDNAddress.verify(O.standLines[F]);if(z)return"standLines."+z}}return null},I.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return O;let F=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(O.roomId!=null&&(F.roomId=String(O.roomId)),O.m3u8!=null&&(F.m3u8=String(O.m3u8)),O.rtmp!=null&&(F.rtmp=String(O.rtmp)),O.flv!=null&&(F.flv=String(O.flv)),O.rtmps!=null&&(F.rtmps=String(O.rtmps)),O.mainLine!=null){if(typeof O.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(O.mainLine)}if(O.standLines){if(!Array.isArray(O.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");F.standLines=[];for(let z=0;z<O.standLines.length;++z){if(typeof O.standLines[z]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");F.standLines[z]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(O.standLines[z])}}return F},I.toObject=function(O,F){F||(F={});let z={};if((F.arrays||F.defaults)&&(z.standLines=[]),F.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.m3u8!=null&&O.hasOwnProperty("m3u8")&&(z.m3u8=O.m3u8,F.oneofs&&(z._m3u8="m3u8")),O.rtmp!=null&&O.hasOwnProperty("rtmp")&&(z.rtmp=O.rtmp,F.oneofs&&(z._rtmp="rtmp")),O.flv!=null&&O.hasOwnProperty("flv")&&(z.flv=O.flv,F.oneofs&&(z._flv="flv")),O.rtmps!=null&&O.hasOwnProperty("rtmps")&&(z.rtmps=O.rtmps,F.oneofs&&(z._rtmps="rtmps")),O.mainLine!=null&&O.hasOwnProperty("mainLine")&&(z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(O.mainLine,F),F.oneofs&&(z._mainLine="mainLine")),O.standLines&&O.standLines.length){z.standLines=[];for(let K=0;K<O.standLines.length;++K)z.standLines[K]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(O.standLines[K],F)}return z},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CDNPlayAddressNotify"},I}(),J.UserChannel=function(){function I(D){if(this.channels=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.userId="",I.prototype.channels=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&O.uint32(10).string(a.userId),a.channels!=null&&a.channels.length)for(let F=0;F<a.channels.length;++F)$root.com.quick.voice.proto.DataChannel.encode(a.channels[F],O.uint32(18).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.UserChannel;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.userId=a.string();break}case 2:{z.channels&&z.channels.length||(z.channels=[]),z.channels.push($root.com.quick.voice.proto.DataChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId))return"userId: string expected";if(a.channels!=null&&a.hasOwnProperty("channels")){if(!Array.isArray(a.channels))return"channels: array expected";for(let O=0;O<a.channels.length;++O){let F=$root.com.quick.voice.proto.DataChannel.verify(a.channels[O]);if(F)return"channels."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.UserChannel)return a;let O=new $root.com.quick.voice.proto.UserChannel;if(a.userId!=null&&(O.userId=String(a.userId)),a.channels){if(!Array.isArray(a.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");O.channels=[];for(let F=0;F<a.channels.length;++F){if(typeof a.channels[F]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");O.channels[F]=$root.com.quick.voice.proto.DataChannel.fromObject(a.channels[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.channels=[]),O.defaults&&(F.userId=""),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId),a.channels&&a.channels.length){F.channels=[];for(let z=0;z<a.channels.length;++z)F.channels[z]=$root.com.quick.voice.proto.DataChannel.toObject(a.channels[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.UserChannel"},I}(),J.ChannelPublishReq=function(){function I(D){if(this.channels=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.channels=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.channels!=null&&a.channels.length)for(let F=0;F<a.channels.length;++F)$root.com.quick.voice.proto.DataChannel.encode(a.channels[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ChannelPublishReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.channels&&z.channels.length||(z.channels=[]),z.channels.push($root.com.quick.voice.proto.DataChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.channels!=null&&a.hasOwnProperty("channels")){if(!Array.isArray(a.channels))return"channels: array expected";for(let O=0;O<a.channels.length;++O){let F=$root.com.quick.voice.proto.DataChannel.verify(a.channels[O]);if(F)return"channels."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ChannelPublishReq)return a;let O=new $root.com.quick.voice.proto.ChannelPublishReq;if(a.channels){if(!Array.isArray(a.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");O.channels=[];for(let F=0;F<a.channels.length;++F){if(typeof a.channels[F]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");O.channels[F]=$root.com.quick.voice.proto.DataChannel.fromObject(a.channels[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.channels=[]),a.channels&&a.channels.length){F.channels=[];for(let z=0;z<a.channels.length;++z)F.channels[z]=$root.com.quick.voice.proto.DataChannel.toObject(a.channels[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ChannelPublishReq"},I}(),J.ChannelPublishRsq=function(){function I(D){if(this.channels=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.channels=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.channels!=null&&a.channels.length)for(let F=0;F<a.channels.length;++F)$root.com.quick.voice.proto.UserChannel.encode(a.channels[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.channels&&z.channels.length||(z.channels=[]),z.channels.push($root.com.quick.voice.proto.UserChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.channels!=null&&a.hasOwnProperty("channels")){if(!Array.isArray(a.channels))return"channels: array expected";for(let O=0;O<a.channels.length;++O){let F=$root.com.quick.voice.proto.UserChannel.verify(a.channels[O]);if(F)return"channels."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return a;let O=new $root.com.quick.voice.proto.ChannelPublishRsq;if(a.channels){if(!Array.isArray(a.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");O.channels=[];for(let F=0;F<a.channels.length;++F){if(typeof a.channels[F]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");O.channels[F]=$root.com.quick.voice.proto.UserChannel.fromObject(a.channels[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.channels=[]),a.channels&&a.channels.length){F.channels=[];for(let z=0;z<a.channels.length;++z)F.channels[z]=$root.com.quick.voice.proto.UserChannel.toObject(a.channels[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ChannelPublishRsq"},I}(),J.ChannelSubscribeReq=function(){function I(D){if(this.users=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.users=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.users!=null&&a.users.length)for(let F=0;F<a.users.length;++F)$root.com.quick.voice.proto.UserChannel.encode(a.users[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.users&&z.users.length||(z.users=[]),z.users.push($root.com.quick.voice.proto.UserChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.users!=null&&a.hasOwnProperty("users")){if(!Array.isArray(a.users))return"users: array expected";for(let O=0;O<a.users.length;++O){let F=$root.com.quick.voice.proto.UserChannel.verify(a.users[O]);if(F)return"users."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return a;let O=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(a.users){if(!Array.isArray(a.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");O.users=[];for(let F=0;F<a.users.length;++F){if(typeof a.users[F]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");O.users[F]=$root.com.quick.voice.proto.UserChannel.fromObject(a.users[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.users=[]),a.users&&a.users.length){F.users=[];for(let z=0;z<a.users.length;++z)F.users[z]=$root.com.quick.voice.proto.UserChannel.toObject(a.users[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ChannelSubscribeReq"},I}(),J.ChannelSubscribeRsq=function(){function I(D){if(this.channels=[],D)for(let a=Object.keys(D),O=0;O<a.length;++O)D[a[O]]!=null&&(this[a[O]]=D[a[O]])}return I.prototype.channels=$util.emptyArray,I.create=function(a){return new I(a)},I.encode=function(a,O){if(O||(O=$Writer.create()),a.channels!=null&&a.channels.length)for(let F=0;F<a.channels.length;++F)$root.com.quick.voice.proto.UserChannel.encode(a.channels[F],O.uint32(10).fork()).ldelim();return O},I.encodeDelimited=function(a,O){return this.encode(a,O).ldelim()},I.decode=function(a,O){a instanceof $Reader||(a=$Reader.create(a));let F=O===void 0?a.len:a.pos+O,z=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;a.pos<F;){let K=a.uint32();switch(K>>>3){case 1:{z.channels&&z.channels.length||(z.channels=[]),z.channels.push($root.com.quick.voice.proto.UserChannel.decode(a,a.uint32()));break}default:a.skipType(K&7);break}}return z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.channels!=null&&a.hasOwnProperty("channels")){if(!Array.isArray(a.channels))return"channels: array expected";for(let O=0;O<a.channels.length;++O){let F=$root.com.quick.voice.proto.UserChannel.verify(a.channels[O]);if(F)return"channels."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return a;let O=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(a.channels){if(!Array.isArray(a.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");O.channels=[];for(let F=0;F<a.channels.length;++F){if(typeof a.channels[F]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");O.channels[F]=$root.com.quick.voice.proto.UserChannel.fromObject(a.channels[F])}}return O},I.toObject=function(a,O){O||(O={});let F={};if((O.arrays||O.defaults)&&(F.channels=[]),a.channels&&a.channels.length){F.channels=[];for(let z=0;z<a.channels.length;++z)F.channels[z]=$root.com.quick.voice.proto.UserChannel.toObject(a.channels[z],O)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.ChannelSubscribeRsq"},I}(),J}(),q}(),Z}(),N})(),ignoreEvent=["networkQualityChange","onNetQuality"],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(N){let Z=N.length;for(;--Z>=0;)N[Z]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(N,Z,q,J,I){this.static_tree=N,this.extra_bits=Z,this.extra_base=q,this.elems=J,this.max_length=I,this.has_stree=N&&N.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(N,Z){this.dyn_tree=N,this.max_code=0,this.stat_desc=Z}const d_code=N=>N<256?_dist_code[N]:_dist_code[256+(N>>>7)],put_short=(N,Z)=>{N.pending_buf[N.pending++]=Z&255,N.pending_buf[N.pending++]=Z>>>8&255},send_bits=(N,Z,q)=>{N.bi_valid>Buf_size-q?(N.bi_buf|=Z<<N.bi_valid&65535,put_short(N,N.bi_buf),N.bi_buf=Z>>Buf_size-N.bi_valid,N.bi_valid+=q-Buf_size):(N.bi_buf|=Z<<N.bi_valid&65535,N.bi_valid+=q)},send_code=(N,Z,q)=>{send_bits(N,q[Z*2],q[Z*2+1])},bi_reverse=(N,Z)=>{let q=0;do q|=N&1,N>>>=1,q<<=1;while(--Z>0);return q>>>1},bi_flush=N=>{N.bi_valid===16?(put_short(N,N.bi_buf),N.bi_buf=0,N.bi_valid=0):N.bi_valid>=8&&(N.pending_buf[N.pending++]=N.bi_buf&255,N.bi_buf>>=8,N.bi_valid-=8)},gen_bitlen=(N,Z)=>{const q=Z.dyn_tree,J=Z.max_code,I=Z.stat_desc.static_tree,D=Z.stat_desc.has_stree,a=Z.stat_desc.extra_bits,O=Z.stat_desc.extra_base,F=Z.stat_desc.max_length;let z,K,te,ne,ee,re,ce=0;for(ne=0;ne<=MAX_BITS$1;ne++)N.bl_count[ne]=0;for(q[N.heap[N.heap_max]*2+1]=0,z=N.heap_max+1;z<HEAP_SIZE$1;z++)K=N.heap[z],ne=q[q[K*2+1]*2+1]+1,ne>F&&(ne=F,ce++),q[K*2+1]=ne,!(K>J)&&(N.bl_count[ne]++,ee=0,K>=O&&(ee=a[K-O]),re=q[K*2],N.opt_len+=re*(ne+ee),D&&(N.static_len+=re*(I[K*2+1]+ee)));if(ce!==0){do{for(ne=F-1;N.bl_count[ne]===0;)ne--;N.bl_count[ne]--,N.bl_count[ne+1]+=2,N.bl_count[F]--,ce-=2}while(ce>0);for(ne=F;ne!==0;ne--)for(K=N.bl_count[ne];K!==0;)te=N.heap[--z],!(te>J)&&(q[te*2+1]!==ne&&(N.opt_len+=(ne-q[te*2+1])*q[te*2],q[te*2+1]=ne),K--)}},gen_codes=(N,Z,q)=>{const J=new Array(MAX_BITS$1+1);let I=0,D,a;for(D=1;D<=MAX_BITS$1;D++)I=I+q[D-1]<<1,J[D]=I;for(a=0;a<=Z;a++){let O=N[a*2+1];O!==0&&(N[a*2]=bi_reverse(J[O]++,O))}},tr_static_init=()=>{let N,Z,q,J,I;const D=new Array(MAX_BITS$1+1);for(q=0,J=0;J<LENGTH_CODES$1-1;J++)for(base_length[J]=q,N=0;N<1<<extra_lbits[J];N++)_length_code[q++]=J;for(_length_code[q-1]=J,I=0,J=0;J<16;J++)for(base_dist[J]=I,N=0;N<1<<extra_dbits[J];N++)_dist_code[I++]=J;for(I>>=7;J<D_CODES$1;J++)for(base_dist[J]=I<<7,N=0;N<1<<extra_dbits[J]-7;N++)_dist_code[256+I++]=J;for(Z=0;Z<=MAX_BITS$1;Z++)D[Z]=0;for(N=0;N<=143;)static_ltree[N*2+1]=8,N++,D[8]++;for(;N<=255;)static_ltree[N*2+1]=9,N++,D[9]++;for(;N<=279;)static_ltree[N*2+1]=7,N++,D[7]++;for(;N<=287;)static_ltree[N*2+1]=8,N++,D[8]++;for(gen_codes(static_ltree,L_CODES$1+1,D),N=0;N<D_CODES$1;N++)static_dtree[N*2+1]=5,static_dtree[N*2]=bi_reverse(N,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=N=>{let Z;for(Z=0;Z<L_CODES$1;Z++)N.dyn_ltree[Z*2]=0;for(Z=0;Z<D_CODES$1;Z++)N.dyn_dtree[Z*2]=0;for(Z=0;Z<BL_CODES$1;Z++)N.bl_tree[Z*2]=0;N.dyn_ltree[END_BLOCK*2]=1,N.opt_len=N.static_len=0,N.sym_next=N.matches=0},bi_windup=N=>{N.bi_valid>8?put_short(N,N.bi_buf):N.bi_valid>0&&(N.pending_buf[N.pending++]=N.bi_buf),N.bi_buf=0,N.bi_valid=0},smaller=(N,Z,q,J)=>{const I=Z*2,D=q*2;return N[I]<N[D]||N[I]===N[D]&&J[Z]<=J[q]},pqdownheap=(N,Z,q)=>{const J=N.heap[q];let I=q<<1;for(;I<=N.heap_len&&(I<N.heap_len&&smaller(Z,N.heap[I+1],N.heap[I],N.depth)&&I++,!smaller(Z,J,N.heap[I],N.depth));)N.heap[q]=N.heap[I],q=I,I<<=1;N.heap[q]=J},compress_block=(N,Z,q)=>{let J,I,D=0,a,O;if(N.sym_next!==0)do J=N.pending_buf[N.sym_buf+D++]&255,J+=(N.pending_buf[N.sym_buf+D++]&255)<<8,I=N.pending_buf[N.sym_buf+D++],J===0?send_code(N,I,Z):(a=_length_code[I],send_code(N,a+LITERALS$1+1,Z),O=extra_lbits[a],O!==0&&(I-=base_length[a],send_bits(N,I,O)),J--,a=d_code(J),send_code(N,a,q),O=extra_dbits[a],O!==0&&(J-=base_dist[a],send_bits(N,J,O)));while(D<N.sym_next);send_code(N,END_BLOCK,Z)},build_tree=(N,Z)=>{const q=Z.dyn_tree,J=Z.stat_desc.static_tree,I=Z.stat_desc.has_stree,D=Z.stat_desc.elems;let a,O,F=-1,z;for(N.heap_len=0,N.heap_max=HEAP_SIZE$1,a=0;a<D;a++)q[a*2]!==0?(N.heap[++N.heap_len]=F=a,N.depth[a]=0):q[a*2+1]=0;for(;N.heap_len<2;)z=N.heap[++N.heap_len]=F<2?++F:0,q[z*2]=1,N.depth[z]=0,N.opt_len--,I&&(N.static_len-=J[z*2+1]);for(Z.max_code=F,a=N.heap_len>>1;a>=1;a--)pqdownheap(N,q,a);z=D;do a=N.heap[1],N.heap[1]=N.heap[N.heap_len--],pqdownheap(N,q,1),O=N.heap[1],N.heap[--N.heap_max]=a,N.heap[--N.heap_max]=O,q[z*2]=q[a*2]+q[O*2],N.depth[z]=(N.depth[a]>=N.depth[O]?N.depth[a]:N.depth[O])+1,q[a*2+1]=q[O*2+1]=z,N.heap[1]=z++,pqdownheap(N,q,1);while(N.heap_len>=2);N.heap[--N.heap_max]=N.heap[1],gen_bitlen(N,Z),gen_codes(q,F,N.bl_count)},scan_tree=(N,Z,q)=>{let J,I=-1,D,a=Z[0*2+1],O=0,F=7,z=4;for(a===0&&(F=138,z=3),Z[(q+1)*2+1]=65535,J=0;J<=q;J++)D=a,a=Z[(J+1)*2+1],!(++O<F&&D===a)&&(O<z?N.bl_tree[D*2]+=O:D!==0?(D!==I&&N.bl_tree[D*2]++,N.bl_tree[REP_3_6*2]++):O<=10?N.bl_tree[REPZ_3_10*2]++:N.bl_tree[REPZ_11_138*2]++,O=0,I=D,a===0?(F=138,z=3):D===a?(F=6,z=3):(F=7,z=4))},send_tree=(N,Z,q)=>{let J,I=-1,D,a=Z[0*2+1],O=0,F=7,z=4;for(a===0&&(F=138,z=3),J=0;J<=q;J++)if(D=a,a=Z[(J+1)*2+1],!(++O<F&&D===a)){if(O<z)do send_code(N,D,N.bl_tree);while(--O!==0);else D!==0?(D!==I&&(send_code(N,D,N.bl_tree),O--),send_code(N,REP_3_6,N.bl_tree),send_bits(N,O-3,2)):O<=10?(send_code(N,REPZ_3_10,N.bl_tree),send_bits(N,O-3,3)):(send_code(N,REPZ_11_138,N.bl_tree),send_bits(N,O-11,7));O=0,I=D,a===0?(F=138,z=3):D===a?(F=6,z=3):(F=7,z=4)}},build_bl_tree=N=>{let Z;for(scan_tree(N,N.dyn_ltree,N.l_desc.max_code),scan_tree(N,N.dyn_dtree,N.d_desc.max_code),build_tree(N,N.bl_desc),Z=BL_CODES$1-1;Z>=3&&N.bl_tree[bl_order[Z]*2+1]===0;Z--);return N.opt_len+=3*(Z+1)+5+5+4,Z},send_all_trees=(N,Z,q,J)=>{let I;for(send_bits(N,Z-257,5),send_bits(N,q-1,5),send_bits(N,J-4,4),I=0;I<J;I++)send_bits(N,N.bl_tree[bl_order[I]*2+1],3);send_tree(N,N.dyn_ltree,Z-1),send_tree(N,N.dyn_dtree,q-1)},detect_data_type=N=>{let Z=4093624447,q;for(q=0;q<=31;q++,Z>>>=1)if(Z&1&&N.dyn_ltree[q*2]!==0)return Z_BINARY;if(N.dyn_ltree[9*2]!==0||N.dyn_ltree[10*2]!==0||N.dyn_ltree[13*2]!==0)return Z_TEXT;for(q=32;q<LITERALS$1;q++)if(N.dyn_ltree[q*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=N=>{static_init_done||(tr_static_init(),static_init_done=!0),N.l_desc=new TreeDesc(N.dyn_ltree,static_l_desc),N.d_desc=new TreeDesc(N.dyn_dtree,static_d_desc),N.bl_desc=new TreeDesc(N.bl_tree,static_bl_desc),N.bi_buf=0,N.bi_valid=0,init_block(N)},_tr_stored_block$1=(N,Z,q,J)=>{send_bits(N,(STORED_BLOCK<<1)+(J?1:0),3),bi_windup(N),put_short(N,q),put_short(N,~q),q&&N.pending_buf.set(N.window.subarray(Z,Z+q),N.pending),N.pending+=q},_tr_align$1=N=>{send_bits(N,STATIC_TREES<<1,3),send_code(N,END_BLOCK,static_ltree),bi_flush(N)},_tr_flush_block$1=(N,Z,q,J)=>{let I,D,a=0;N.level>0?(N.strm.data_type===Z_UNKNOWN$1&&(N.strm.data_type=detect_data_type(N)),build_tree(N,N.l_desc),build_tree(N,N.d_desc),a=build_bl_tree(N),I=N.opt_len+3+7>>>3,D=N.static_len+3+7>>>3,D<=I&&(I=D)):I=D=q+5,q+4<=I&&Z!==-1?_tr_stored_block$1(N,Z,q,J):N.strategy===Z_FIXED$1||D===I?(send_bits(N,(STATIC_TREES<<1)+(J?1:0),3),compress_block(N,static_ltree,static_dtree)):(send_bits(N,(DYN_TREES<<1)+(J?1:0),3),send_all_trees(N,N.l_desc.max_code+1,N.d_desc.max_code+1,a+1),compress_block(N,N.dyn_ltree,N.dyn_dtree)),init_block(N),J&&bi_windup(N)},_tr_tally$1=(N,Z,q)=>(N.pending_buf[N.sym_buf+N.sym_next++]=Z,N.pending_buf[N.sym_buf+N.sym_next++]=Z>>8,N.pending_buf[N.sym_buf+N.sym_next++]=q,Z===0?N.dyn_ltree[q*2]++:(N.matches++,Z--,N.dyn_ltree[(_length_code[q]+LITERALS$1+1)*2]++,N.dyn_dtree[d_code(Z)*2]++),N.sym_next===N.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(N,Z,q,J)=>{let I=N&65535|0,D=N>>>16&65535|0,a=0;for(;q!==0;){a=q>2e3?2e3:q,q-=a;do I=I+Z[J++]|0,D=D+I|0;while(--a);I%=65521,D%=65521}return I|D<<16|0};var adler32_1=adler32;const makeTable=()=>{let N,Z=[];for(var q=0;q<256;q++){N=q;for(var J=0;J<8;J++)N=N&1?3988292384^N>>>1:N>>>1;Z[q]=N}return Z},crcTable=new Uint32Array(makeTable()),crc32=(N,Z,q,J)=>{const I=crcTable,D=J+q;N^=-1;for(let a=J;a<D;a++)N=N>>>8^I[(N^Z[a])&255];return N^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(N,Z)=>(N.msg=messages[Z],Z),rank=N=>N*2-(N>4?9:0),zero=N=>{let Z=N.length;for(;--Z>=0;)N[Z]=0},slide_hash=N=>{let Z,q,J,I=N.w_size;Z=N.hash_size,J=Z;do q=N.head[--J],N.head[J]=q>=I?q-I:0;while(--Z);Z=I,J=Z;do q=N.prev[--J],N.prev[J]=q>=I?q-I:0;while(--Z)};let HASH_ZLIB=(N,Z,q)=>(Z<<N.hash_shift^q)&N.hash_mask,HASH=HASH_ZLIB;const flush_pending=N=>{const Z=N.state;let q=Z.pending;q>N.avail_out&&(q=N.avail_out),q!==0&&(N.output.set(Z.pending_buf.subarray(Z.pending_out,Z.pending_out+q),N.next_out),N.next_out+=q,Z.pending_out+=q,N.total_out+=q,N.avail_out-=q,Z.pending-=q,Z.pending===0&&(Z.pending_out=0))},flush_block_only=(N,Z)=>{_tr_flush_block(N,N.block_start>=0?N.block_start:-1,N.strstart-N.block_start,Z),N.block_start=N.strstart,flush_pending(N.strm)},put_byte=(N,Z)=>{N.pending_buf[N.pending++]=Z},putShortMSB=(N,Z)=>{N.pending_buf[N.pending++]=Z>>>8&255,N.pending_buf[N.pending++]=Z&255},read_buf=(N,Z,q,J)=>{let I=N.avail_in;return I>J&&(I=J),I===0?0:(N.avail_in-=I,Z.set(N.input.subarray(N.next_in,N.next_in+I),q),N.state.wrap===1?N.adler=adler32_1(N.adler,Z,I,q):N.state.wrap===2&&(N.adler=crc32_1(N.adler,Z,I,q)),N.next_in+=I,N.total_in+=I,I)},longest_match=(N,Z)=>{let q=N.max_chain_length,J=N.strstart,I,D,a=N.prev_length,O=N.nice_match;const F=N.strstart>N.w_size-MIN_LOOKAHEAD?N.strstart-(N.w_size-MIN_LOOKAHEAD):0,z=N.window,K=N.w_mask,te=N.prev,ne=N.strstart+MAX_MATCH;let ee=z[J+a-1],re=z[J+a];N.prev_length>=N.good_match&&(q>>=2),O>N.lookahead&&(O=N.lookahead);do if(I=Z,!(z[I+a]!==re||z[I+a-1]!==ee||z[I]!==z[J]||z[++I]!==z[J+1])){J+=2,I++;do;while(z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&z[++J]===z[++I]&&J<ne);if(D=MAX_MATCH-(ne-J),J=ne-MAX_MATCH,D>a){if(N.match_start=Z,a=D,D>=O)break;ee=z[J+a-1],re=z[J+a]}}while((Z=te[Z&K])>F&&--q!==0);return a<=N.lookahead?a:N.lookahead},fill_window=N=>{const Z=N.w_size;let q,J,I;do{if(J=N.window_size-N.lookahead-N.strstart,N.strstart>=Z+(Z-MIN_LOOKAHEAD)&&(N.window.set(N.window.subarray(Z,Z+Z-J),0),N.match_start-=Z,N.strstart-=Z,N.block_start-=Z,N.insert>N.strstart&&(N.insert=N.strstart),slide_hash(N),J+=Z),N.strm.avail_in===0)break;if(q=read_buf(N.strm,N.window,N.strstart+N.lookahead,J),N.lookahead+=q,N.lookahead+N.insert>=MIN_MATCH)for(I=N.strstart-N.insert,N.ins_h=N.window[I],N.ins_h=HASH(N,N.ins_h,N.window[I+1]);N.insert&&(N.ins_h=HASH(N,N.ins_h,N.window[I+MIN_MATCH-1]),N.prev[I&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=I,I++,N.insert--,!(N.lookahead+N.insert<MIN_MATCH)););}while(N.lookahead<MIN_LOOKAHEAD&&N.strm.avail_in!==0)},deflate_stored=(N,Z)=>{let q=N.pending_buf_size-5>N.w_size?N.w_size:N.pending_buf_size-5,J,I,D,a=0,O=N.strm.avail_in;do{if(J=65535,D=N.bi_valid+42>>3,N.strm.avail_out<D||(D=N.strm.avail_out-D,I=N.strstart-N.block_start,J>I+N.strm.avail_in&&(J=I+N.strm.avail_in),J>D&&(J=D),J<q&&(J===0&&Z!==Z_FINISH$3||Z===Z_NO_FLUSH$2||J!==I+N.strm.avail_in)))break;a=Z===Z_FINISH$3&&J===I+N.strm.avail_in?1:0,_tr_stored_block(N,0,0,a),N.pending_buf[N.pending-4]=J,N.pending_buf[N.pending-3]=J>>8,N.pending_buf[N.pending-2]=~J,N.pending_buf[N.pending-1]=~J>>8,flush_pending(N.strm),I&&(I>J&&(I=J),N.strm.output.set(N.window.subarray(N.block_start,N.block_start+I),N.strm.next_out),N.strm.next_out+=I,N.strm.avail_out-=I,N.strm.total_out+=I,N.block_start+=I,J-=I),J&&(read_buf(N.strm,N.strm.output,N.strm.next_out,J),N.strm.next_out+=J,N.strm.avail_out-=J,N.strm.total_out+=J)}while(a===0);return O-=N.strm.avail_in,O&&(O>=N.w_size?(N.matches=2,N.window.set(N.strm.input.subarray(N.strm.next_in-N.w_size,N.strm.next_in),0),N.strstart=N.w_size,N.insert=N.strstart):(N.window_size-N.strstart<=O&&(N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,N.insert>N.strstart&&(N.insert=N.strstart)),N.window.set(N.strm.input.subarray(N.strm.next_in-O,N.strm.next_in),N.strstart),N.strstart+=O,N.insert+=O>N.w_size-N.insert?N.w_size-N.insert:O),N.block_start=N.strstart),N.high_water<N.strstart&&(N.high_water=N.strstart),a?BS_FINISH_DONE:Z!==Z_NO_FLUSH$2&&Z!==Z_FINISH$3&&N.strm.avail_in===0&&N.strstart===N.block_start?BS_BLOCK_DONE:(D=N.window_size-N.strstart,N.strm.avail_in>D&&N.block_start>=N.w_size&&(N.block_start-=N.w_size,N.strstart-=N.w_size,N.window.set(N.window.subarray(N.w_size,N.w_size+N.strstart),0),N.matches<2&&N.matches++,D+=N.w_size,N.insert>N.strstart&&(N.insert=N.strstart)),D>N.strm.avail_in&&(D=N.strm.avail_in),D&&(read_buf(N.strm,N.window,N.strstart,D),N.strstart+=D,N.insert+=D>N.w_size-N.insert?N.w_size-N.insert:D),N.high_water<N.strstart&&(N.high_water=N.strstart),D=N.bi_valid+42>>3,D=N.pending_buf_size-D>65535?65535:N.pending_buf_size-D,q=D>N.w_size?N.w_size:D,I=N.strstart-N.block_start,(I>=q||(I||Z===Z_FINISH$3)&&Z!==Z_NO_FLUSH$2&&N.strm.avail_in===0&&I<=D)&&(J=I>D?D:I,a=Z===Z_FINISH$3&&N.strm.avail_in===0&&J===I?1:0,_tr_stored_block(N,N.block_start,J,a),N.block_start+=J,flush_pending(N.strm)),a?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(N,Z)=>{let q,J;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(q=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),q=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),q!==0&&N.strstart-q<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,q)),N.match_length>=MIN_MATCH)if(J=_tr_tally(N,N.strstart-N.match_start,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=MIN_MATCH){N.match_length--;do N.strstart++,N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),q=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart;while(--N.match_length!==0);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+1]);else J=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(J&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,Z===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(N,Z)=>{let q,J,I;for(;;){if(N.lookahead<MIN_LOOKAHEAD){if(fill_window(N),N.lookahead<MIN_LOOKAHEAD&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(q=0,N.lookahead>=MIN_MATCH&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),q=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=MIN_MATCH-1,q!==0&&N.prev_length<N.max_lazy_match&&N.strstart-q<=N.w_size-MIN_LOOKAHEAD&&(N.match_length=longest_match(N,q),N.match_length<=5&&(N.strategy===Z_FILTERED||N.match_length===MIN_MATCH&&N.strstart-N.match_start>4096)&&(N.match_length=MIN_MATCH-1)),N.prev_length>=MIN_MATCH&&N.match_length<=N.prev_length){I=N.strstart+N.lookahead-MIN_MATCH,J=_tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-MIN_MATCH),N.lookahead-=N.prev_length-1,N.prev_length-=2;do++N.strstart<=I&&(N.ins_h=HASH(N,N.ins_h,N.window[N.strstart+MIN_MATCH-1]),q=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart);while(--N.prev_length!==0);if(N.match_available=0,N.match_length=MIN_MATCH-1,N.strstart++,J&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}else if(N.match_available){if(J=_tr_tally(N,0,N.window[N.strstart-1]),J&&flush_block_only(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return BS_NEED_MORE}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(J=_tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<MIN_MATCH-1?N.strstart:MIN_MATCH-1,Z===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(N,Z)=>{let q,J,I,D;const a=N.window;for(;;){if(N.lookahead<=MAX_MATCH){if(fill_window(N),N.lookahead<=MAX_MATCH&&Z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=MIN_MATCH&&N.strstart>0&&(I=N.strstart-1,J=a[I],J===a[++I]&&J===a[++I]&&J===a[++I])){D=N.strstart+MAX_MATCH;do;while(J===a[++I]&&J===a[++I]&&J===a[++I]&&J===a[++I]&&J===a[++I]&&J===a[++I]&&J===a[++I]&&J===a[++I]&&I<D);N.match_length=MAX_MATCH-(D-I),N.match_length>N.lookahead&&(N.match_length=N.lookahead)}if(N.match_length>=MIN_MATCH?(q=_tr_tally(N,1,N.match_length-MIN_MATCH),N.lookahead-=N.match_length,N.strstart+=N.match_length,N.match_length=0):(q=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++),q&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,Z===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(N,Z)=>{let q;for(;;){if(N.lookahead===0&&(fill_window(N),N.lookahead===0)){if(Z===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(N.match_length=0,q=_tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++,q&&(flush_block_only(N,!1),N.strm.avail_out===0))return BS_NEED_MORE}return N.insert=0,Z===Z_FINISH$3?(flush_block_only(N,!0),N.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):N.sym_next&&(flush_block_only(N,!1),N.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(N,Z,q,J,I){this.good_length=N,this.max_lazy=Z,this.nice_length=q,this.max_chain=J,this.func=I}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=N=>{N.window_size=2*N.w_size,zero(N.head),N.max_lazy_match=configuration_table[N.level].max_lazy,N.good_match=configuration_table[N.level].good_length,N.nice_match=configuration_table[N.level].nice_length,N.max_chain_length=configuration_table[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=MIN_MATCH-1,N.match_available=0,N.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=N=>{if(!N)return 1;const Z=N.state;return!Z||Z.strm!==N||Z.status!==INIT_STATE&&Z.status!==GZIP_STATE&&Z.status!==EXTRA_STATE&&Z.status!==NAME_STATE&&Z.status!==COMMENT_STATE&&Z.status!==HCRC_STATE&&Z.status!==BUSY_STATE&&Z.status!==FINISH_STATE?1:0},deflateResetKeep=N=>{if(deflateStateCheck(N))return err(N,Z_STREAM_ERROR$2);N.total_in=N.total_out=0,N.data_type=Z_UNKNOWN;const Z=N.state;return Z.pending=0,Z.pending_out=0,Z.wrap<0&&(Z.wrap=-Z.wrap),Z.status=Z.wrap===2?GZIP_STATE:Z.wrap?INIT_STATE:BUSY_STATE,N.adler=Z.wrap===2?0:1,Z.last_flush=-2,_tr_init(Z),Z_OK$3},deflateReset=N=>{const Z=deflateResetKeep(N);return Z===Z_OK$3&&lm_init(N.state),Z},deflateSetHeader=(N,Z)=>deflateStateCheck(N)||N.state.wrap!==2?Z_STREAM_ERROR$2:(N.state.gzhead=Z,Z_OK$3),deflateInit2=(N,Z,q,J,I,D)=>{if(!N)return Z_STREAM_ERROR$2;let a=1;if(Z===Z_DEFAULT_COMPRESSION$1&&(Z=6),J<0?(a=0,J=-J):J>15&&(a=2,J-=16),I<1||I>MAX_MEM_LEVEL||q!==Z_DEFLATED$2||J<8||J>15||Z<0||Z>9||D<0||D>Z_FIXED||J===8&&a!==1)return err(N,Z_STREAM_ERROR$2);J===8&&(J=9);const O=new DeflateState;return N.state=O,O.strm=N,O.status=INIT_STATE,O.wrap=a,O.gzhead=null,O.w_bits=J,O.w_size=1<<O.w_bits,O.w_mask=O.w_size-1,O.hash_bits=I+7,O.hash_size=1<<O.hash_bits,O.hash_mask=O.hash_size-1,O.hash_shift=~~((O.hash_bits+MIN_MATCH-1)/MIN_MATCH),O.window=new Uint8Array(O.w_size*2),O.head=new Uint16Array(O.hash_size),O.prev=new Uint16Array(O.w_size),O.lit_bufsize=1<<I+6,O.pending_buf_size=O.lit_bufsize*4,O.pending_buf=new Uint8Array(O.pending_buf_size),O.sym_buf=O.lit_bufsize,O.sym_end=(O.lit_bufsize-1)*3,O.level=Z,O.strategy=D,O.method=q,deflateReset(N)},deflateInit=(N,Z)=>deflateInit2(N,Z,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(N,Z)=>{if(deflateStateCheck(N)||Z>Z_BLOCK$1||Z<0)return N?err(N,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const q=N.state;if(!N.output||N.avail_in!==0&&!N.input||q.status===FINISH_STATE&&Z!==Z_FINISH$3)return err(N,N.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const J=q.last_flush;if(q.last_flush=Z,q.pending!==0){if(flush_pending(N),N.avail_out===0)return q.last_flush=-1,Z_OK$3}else if(N.avail_in===0&&rank(Z)<=rank(J)&&Z!==Z_FINISH$3)return err(N,Z_BUF_ERROR$1);if(q.status===FINISH_STATE&&N.avail_in!==0)return err(N,Z_BUF_ERROR$1);if(q.status===INIT_STATE&&q.wrap===0&&(q.status=BUSY_STATE),q.status===INIT_STATE){let I=Z_DEFLATED$2+(q.w_bits-8<<4)<<8,D=-1;if(q.strategy>=Z_HUFFMAN_ONLY||q.level<2?D=0:q.level<6?D=1:q.level===6?D=2:D=3,I|=D<<6,q.strstart!==0&&(I|=PRESET_DICT),I+=31-I%31,putShortMSB(q,I),q.strstart!==0&&(putShortMSB(q,N.adler>>>16),putShortMSB(q,N.adler&65535)),N.adler=1,q.status=BUSY_STATE,flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3}if(q.status===GZIP_STATE){if(N.adler=0,put_byte(q,31),put_byte(q,139),put_byte(q,8),q.gzhead)put_byte(q,(q.gzhead.text?1:0)+(q.gzhead.hcrc?2:0)+(q.gzhead.extra?4:0)+(q.gzhead.name?8:0)+(q.gzhead.comment?16:0)),put_byte(q,q.gzhead.time&255),put_byte(q,q.gzhead.time>>8&255),put_byte(q,q.gzhead.time>>16&255),put_byte(q,q.gzhead.time>>24&255),put_byte(q,q.level===9?2:q.strategy>=Z_HUFFMAN_ONLY||q.level<2?4:0),put_byte(q,q.gzhead.os&255),q.gzhead.extra&&q.gzhead.extra.length&&(put_byte(q,q.gzhead.extra.length&255),put_byte(q,q.gzhead.extra.length>>8&255)),q.gzhead.hcrc&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending,0)),q.gzindex=0,q.status=EXTRA_STATE;else if(put_byte(q,0),put_byte(q,0),put_byte(q,0),put_byte(q,0),put_byte(q,0),put_byte(q,q.level===9?2:q.strategy>=Z_HUFFMAN_ONLY||q.level<2?4:0),put_byte(q,OS_CODE),q.status=BUSY_STATE,flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3}if(q.status===EXTRA_STATE){if(q.gzhead.extra){let I=q.pending,D=(q.gzhead.extra.length&65535)-q.gzindex;for(;q.pending+D>q.pending_buf_size;){let O=q.pending_buf_size-q.pending;if(q.pending_buf.set(q.gzhead.extra.subarray(q.gzindex,q.gzindex+O),q.pending),q.pending=q.pending_buf_size,q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I)),q.gzindex+=O,flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3;I=0,D-=O}let a=new Uint8Array(q.gzhead.extra);q.pending_buf.set(a.subarray(q.gzindex,q.gzindex+D),q.pending),q.pending+=D,q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I)),q.gzindex=0}q.status=NAME_STATE}if(q.status===NAME_STATE){if(q.gzhead.name){let I=q.pending,D;do{if(q.pending===q.pending_buf_size){if(q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I)),flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3;I=0}q.gzindex<q.gzhead.name.length?D=q.gzhead.name.charCodeAt(q.gzindex++)&255:D=0,put_byte(q,D)}while(D!==0);q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I)),q.gzindex=0}q.status=COMMENT_STATE}if(q.status===COMMENT_STATE){if(q.gzhead.comment){let I=q.pending,D;do{if(q.pending===q.pending_buf_size){if(q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I)),flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3;I=0}q.gzindex<q.gzhead.comment.length?D=q.gzhead.comment.charCodeAt(q.gzindex++)&255:D=0,put_byte(q,D)}while(D!==0);q.gzhead.hcrc&&q.pending>I&&(N.adler=crc32_1(N.adler,q.pending_buf,q.pending-I,I))}q.status=HCRC_STATE}if(q.status===HCRC_STATE){if(q.gzhead.hcrc){if(q.pending+2>q.pending_buf_size&&(flush_pending(N),q.pending!==0))return q.last_flush=-1,Z_OK$3;put_byte(q,N.adler&255),put_byte(q,N.adler>>8&255),N.adler=0}if(q.status=BUSY_STATE,flush_pending(N),q.pending!==0)return q.last_flush=-1,Z_OK$3}if(N.avail_in!==0||q.lookahead!==0||Z!==Z_NO_FLUSH$2&&q.status!==FINISH_STATE){let I=q.level===0?deflate_stored(q,Z):q.strategy===Z_HUFFMAN_ONLY?deflate_huff(q,Z):q.strategy===Z_RLE?deflate_rle(q,Z):configuration_table[q.level].func(q,Z);if((I===BS_FINISH_STARTED||I===BS_FINISH_DONE)&&(q.status=FINISH_STATE),I===BS_NEED_MORE||I===BS_FINISH_STARTED)return N.avail_out===0&&(q.last_flush=-1),Z_OK$3;if(I===BS_BLOCK_DONE&&(Z===Z_PARTIAL_FLUSH?_tr_align(q):Z!==Z_BLOCK$1&&(_tr_stored_block(q,0,0,!1),Z===Z_FULL_FLUSH$1&&(zero(q.head),q.lookahead===0&&(q.strstart=0,q.block_start=0,q.insert=0))),flush_pending(N),N.avail_out===0))return q.last_flush=-1,Z_OK$3}return Z!==Z_FINISH$3?Z_OK$3:q.wrap<=0?Z_STREAM_END$3:(q.wrap===2?(put_byte(q,N.adler&255),put_byte(q,N.adler>>8&255),put_byte(q,N.adler>>16&255),put_byte(q,N.adler>>24&255),put_byte(q,N.total_in&255),put_byte(q,N.total_in>>8&255),put_byte(q,N.total_in>>16&255),put_byte(q,N.total_in>>24&255)):(putShortMSB(q,N.adler>>>16),putShortMSB(q,N.adler&65535)),flush_pending(N),q.wrap>0&&(q.wrap=-q.wrap),q.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=N=>{if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const Z=N.state.status;return N.state=null,Z===BUSY_STATE?err(N,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(N,Z)=>{let q=Z.length;if(deflateStateCheck(N))return Z_STREAM_ERROR$2;const J=N.state,I=J.wrap;if(I===2||I===1&&J.status!==INIT_STATE||J.lookahead)return Z_STREAM_ERROR$2;if(I===1&&(N.adler=adler32_1(N.adler,Z,q,0)),J.wrap=0,q>=J.w_size){I===0&&(zero(J.head),J.strstart=0,J.block_start=0,J.insert=0);let F=new Uint8Array(J.w_size);F.set(Z.subarray(q-J.w_size,q),0),Z=F,q=J.w_size}const D=N.avail_in,a=N.next_in,O=N.input;for(N.avail_in=q,N.next_in=0,N.input=Z,fill_window(J);J.lookahead>=MIN_MATCH;){let F=J.strstart,z=J.lookahead-(MIN_MATCH-1);do J.ins_h=HASH(J,J.ins_h,J.window[F+MIN_MATCH-1]),J.prev[F&J.w_mask]=J.head[J.ins_h],J.head[J.ins_h]=F,F++;while(--z);J.strstart=F,J.lookahead=MIN_MATCH-1,fill_window(J)}return J.strstart+=J.lookahead,J.block_start=J.strstart,J.insert=J.lookahead,J.lookahead=0,J.match_length=J.prev_length=MIN_MATCH-1,J.match_available=0,N.next_in=a,N.input=O,N.avail_in=D,J.wrap=I,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(N,Z)=>Object.prototype.hasOwnProperty.call(N,Z);var assign=function(N){const Z=Array.prototype.slice.call(arguments,1);for(;Z.length;){const q=Z.shift();if(q){if(typeof q!="object")throw new TypeError(q+"must be non-object");for(const J in q)_has(q,J)&&(N[J]=q[J])}}return N},flattenChunks=N=>{let Z=0;for(let J=0,I=N.length;J<I;J++)Z+=N[J].length;const q=new Uint8Array(Z);for(let J=0,I=0,D=N.length;J<D;J++){let a=N[J];q.set(a,I),I+=a.length}return q},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(N){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let N=0;N<256;N++)_utf8len[N]=N>=252?6:N>=248?5:N>=240?4:N>=224?3:N>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=N=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(N);let Z,q,J,I,D,a=N.length,O=0;for(I=0;I<a;I++)q=N.charCodeAt(I),(q&64512)===55296&&I+1<a&&(J=N.charCodeAt(I+1),(J&64512)===56320&&(q=65536+(q-55296<<10)+(J-56320),I++)),O+=q<128?1:q<2048?2:q<65536?3:4;for(Z=new Uint8Array(O),D=0,I=0;D<O;I++)q=N.charCodeAt(I),(q&64512)===55296&&I+1<a&&(J=N.charCodeAt(I+1),(J&64512)===56320&&(q=65536+(q-55296<<10)+(J-56320),I++)),q<128?Z[D++]=q:q<2048?(Z[D++]=192|q>>>6,Z[D++]=128|q&63):q<65536?(Z[D++]=224|q>>>12,Z[D++]=128|q>>>6&63,Z[D++]=128|q&63):(Z[D++]=240|q>>>18,Z[D++]=128|q>>>12&63,Z[D++]=128|q>>>6&63,Z[D++]=128|q&63);return Z};const buf2binstring=(N,Z)=>{if(Z<65534&&N.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,N.length===Z?N:N.subarray(0,Z));let q="";for(let J=0;J<Z;J++)q+=String.fromCharCode(N[J]);return q};var buf2string=(N,Z)=>{const q=Z||N.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(N.subarray(0,Z));let J,I;const D=new Array(q*2);for(I=0,J=0;J<q;){let a=N[J++];if(a<128){D[I++]=a;continue}let O=_utf8len[a];if(O>4){D[I++]=65533,J+=O-1;continue}for(a&=O===2?31:O===3?15:7;O>1&&J<q;)a=a<<6|N[J++]&63,O--;if(O>1){D[I++]=65533;continue}a<65536?D[I++]=a:(a-=65536,D[I++]=55296|a>>10&1023,D[I++]=56320|a&1023)}return buf2binstring(D,I)},utf8border=(N,Z)=>{Z=Z||N.length,Z>N.length&&(Z=N.length);let q=Z-1;for(;q>=0&&(N[q]&192)===128;)q--;return q<0||q===0?Z:q+_utf8len[N[q]]>Z?q:Z},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(N){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},N||{});let Z=this.options;Z.raw&&Z.windowBits>0?Z.windowBits=-Z.windowBits:Z.gzip&&Z.windowBits>0&&Z.windowBits<16&&(Z.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let q=deflate_1$2.deflateInit2(this.strm,Z.level,Z.method,Z.windowBits,Z.memLevel,Z.strategy);if(q!==Z_OK$2)throw new Error(messages[q]);if(Z.header&&deflate_1$2.deflateSetHeader(this.strm,Z.header),Z.dictionary){let J;if(typeof Z.dictionary=="string"?J=strings.string2buf(Z.dictionary):toString$1.call(Z.dictionary)==="[object ArrayBuffer]"?J=new Uint8Array(Z.dictionary):J=Z.dictionary,q=deflate_1$2.deflateSetDictionary(this.strm,J),q!==Z_OK$2)throw new Error(messages[q]);this._dict_set=!0}}Deflate$1.prototype.push=function(N,Z){const q=this.strm,J=this.options.chunkSize;let I,D;if(this.ended)return!1;for(Z===~~Z?D=Z:D=Z===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof N=="string"?q.input=strings.string2buf(N):toString$1.call(N)==="[object ArrayBuffer]"?q.input=new Uint8Array(N):q.input=N,q.next_in=0,q.avail_in=q.input.length;;){if(q.avail_out===0&&(q.output=new Uint8Array(J),q.next_out=0,q.avail_out=J),(D===Z_SYNC_FLUSH||D===Z_FULL_FLUSH)&&q.avail_out<=6){this.onData(q.output.subarray(0,q.next_out)),q.avail_out=0;continue}if(I=deflate_1$2.deflate(q,D),I===Z_STREAM_END$2)return q.next_out>0&&this.onData(q.output.subarray(0,q.next_out)),I=deflate_1$2.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===Z_OK$2;if(q.avail_out===0){this.onData(q.output);continue}if(D>0&&q.next_out>0){this.onData(q.output.subarray(0,q.next_out)),q.avail_out=0;continue}if(q.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(N){this.chunks.push(N)},Deflate$1.prototype.onEnd=function(N){N===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function deflate$1(N,Z){const q=new Deflate$1(Z);if(q.push(N,!0),q.err)throw q.msg||messages[q.err];return q.result}function deflateRaw$1(N,Z){return Z=Z||{},Z.raw=!0,deflate$1(N,Z)}function gzip$1(N,Z){return Z=Z||{},Z.gzip=!0,deflate$1(N,Z)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function N(Z,q){let J,I,D,a,O,F,z,K,te,ne,ee,re,ce,oe,se,fe,ge,ue,_e,pe,ye,we,Ie,be;const Se=Z.state;J=Z.next_in,Ie=Z.input,I=J+(Z.avail_in-5),D=Z.next_out,be=Z.output,a=D-(q-Z.avail_out),O=D+(Z.avail_out-257),F=Se.dmax,z=Se.wsize,K=Se.whave,te=Se.wnext,ne=Se.window,ee=Se.hold,re=Se.bits,ce=Se.lencode,oe=Se.distcode,se=(1<<Se.lenbits)-1,fe=(1<<Se.distbits)-1;e:do{re<15&&(ee+=Ie[J++]<<re,re+=8,ee+=Ie[J++]<<re,re+=8),ge=ce[ee&se];t:for(;;){if(ue=ge>>>24,ee>>>=ue,re-=ue,ue=ge>>>16&255,ue===0)be[D++]=ge&65535;else if(ue&16){_e=ge&65535,ue&=15,ue&&(re<ue&&(ee+=Ie[J++]<<re,re+=8),_e+=ee&(1<<ue)-1,ee>>>=ue,re-=ue),re<15&&(ee+=Ie[J++]<<re,re+=8,ee+=Ie[J++]<<re,re+=8),ge=oe[ee&fe];n:for(;;){if(ue=ge>>>24,ee>>>=ue,re-=ue,ue=ge>>>16&255,ue&16){if(pe=ge&65535,ue&=15,re<ue&&(ee+=Ie[J++]<<re,re+=8,re<ue&&(ee+=Ie[J++]<<re,re+=8)),pe+=ee&(1<<ue)-1,pe>F){Z.msg="invalid distance too far back",Se.mode=BAD$1;break e}if(ee>>>=ue,re-=ue,ue=D-a,pe>ue){if(ue=pe-ue,ue>K&&Se.sane){Z.msg="invalid distance too far back",Se.mode=BAD$1;break e}if(ye=0,we=ne,te===0){if(ye+=z-ue,ue<_e){_e-=ue;do be[D++]=ne[ye++];while(--ue);ye=D-pe,we=be}}else if(te<ue){if(ye+=z+te-ue,ue-=te,ue<_e){_e-=ue;do be[D++]=ne[ye++];while(--ue);if(ye=0,te<_e){ue=te,_e-=ue;do be[D++]=ne[ye++];while(--ue);ye=D-pe,we=be}}}else if(ye+=te-ue,ue<_e){_e-=ue;do be[D++]=ne[ye++];while(--ue);ye=D-pe,we=be}for(;_e>2;)be[D++]=we[ye++],be[D++]=we[ye++],be[D++]=we[ye++],_e-=3;_e&&(be[D++]=we[ye++],_e>1&&(be[D++]=we[ye++]))}else{ye=D-pe;do be[D++]=be[ye++],be[D++]=be[ye++],be[D++]=be[ye++],_e-=3;while(_e>2);_e&&(be[D++]=be[ye++],_e>1&&(be[D++]=be[ye++]))}}else if((ue&64)===0){ge=oe[(ge&65535)+(ee&(1<<ue)-1)];continue n}else{Z.msg="invalid distance code",Se.mode=BAD$1;break e}break}}else if((ue&64)===0){ge=ce[(ge&65535)+(ee&(1<<ue)-1)];continue t}else if(ue&32){Se.mode=TYPE$1;break e}else{Z.msg="invalid literal/length code",Se.mode=BAD$1;break e}break}}while(J<I&&D<O);_e=re>>3,J-=_e,re-=_e<<3,ee&=(1<<re)-1,Z.next_in=J,Z.next_out=D,Z.avail_in=J<I?5+(I-J):5-(J-I),Z.avail_out=D<O?257+(O-D):257-(D-O),Se.hold=ee,Se.bits=re};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(N,Z,q,J,I,D,a,O)=>{const F=O.bits;let z=0,K=0,te=0,ne=0,ee=0,re=0,ce=0,oe=0,se=0,fe=0,ge,ue,_e,pe,ye,we=null,Ie;const be=new Uint16Array(MAXBITS+1),Se=new Uint16Array(MAXBITS+1);let Me=null,We,Je,Le;for(z=0;z<=MAXBITS;z++)be[z]=0;for(K=0;K<J;K++)be[Z[q+K]]++;for(ee=F,ne=MAXBITS;ne>=1&&be[ne]===0;ne--);if(ee>ne&&(ee=ne),ne===0)return I[D++]=1<<24|64<<16|0,I[D++]=1<<24|64<<16|0,O.bits=1,0;for(te=1;te<ne&&be[te]===0;te++);for(ee<te&&(ee=te),oe=1,z=1;z<=MAXBITS;z++)if(oe<<=1,oe-=be[z],oe<0)return-1;if(oe>0&&(N===CODES$1||ne!==1))return-1;for(Se[1]=0,z=1;z<MAXBITS;z++)Se[z+1]=Se[z]+be[z];for(K=0;K<J;K++)Z[q+K]!==0&&(a[Se[Z[q+K]]++]=K);if(N===CODES$1?(we=Me=a,Ie=20):N===LENS$1?(we=lbase,Me=lext,Ie=257):(we=dbase,Me=dext,Ie=0),fe=0,K=0,z=te,ye=D,re=ee,ce=0,_e=-1,se=1<<ee,pe=se-1,N===LENS$1&&se>ENOUGH_LENS$1||N===DISTS$1&&se>ENOUGH_DISTS$1)return 1;for(;;){We=z-ce,a[K]+1<Ie?(Je=0,Le=a[K]):a[K]>=Ie?(Je=Me[a[K]-Ie],Le=we[a[K]-Ie]):(Je=96,Le=0),ge=1<<z-ce,ue=1<<re,te=ue;do ue-=ge,I[ye+(fe>>ce)+ue]=We<<24|Je<<16|Le|0;while(ue!==0);for(ge=1<<z-1;fe≥)ge>>=1;if(ge!==0?(fe&=ge-1,fe+=ge):fe=0,K++,--be[z]===0){if(z===ne)break;z=Z[q+a[K]]}if(z>ee&&(fe&pe)!==_e){for(ce===0&&(ce=ee),ye+=te,re=z-ce,oe=1<<re;re+ce<ne&&(oe-=be[re+ce],!(oe<=0));)re++,oe<<=1;if(se+=1<<re,N===LENS$1&&se>ENOUGH_LENS$1||N===DISTS$1&&se>ENOUGH_DISTS$1)return 1;_e=fe&pe,I[_e]=ee<<24|re<<16|ye-D|0}}return fe!==0&&(I[ye+fe]=z-ce<<24|64<<16|0),O.bits=ee,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=N=>(N>>>24&255)+(N>>>8&65280)+((N&65280)<<8)+((N&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=N=>{if(!N)return 1;const Z=N.state;return!Z||Z.strm!==N||Z.mode<HEAD||Z.mode>SYNC?1:0},inflateResetKeep=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const Z=N.state;return N.total_in=N.total_out=Z.total=0,N.msg="",Z.wrap&&(N.adler=Z.wrap&1),Z.mode=HEAD,Z.last=0,Z.havedict=0,Z.flags=-1,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new Int32Array(ENOUGH_LENS),Z.distcode=Z.distdyn=new Int32Array(ENOUGH_DISTS),Z.sane=1,Z.back=-1,Z_OK$1},inflateReset=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const Z=N.state;return Z.wsize=0,Z.whave=0,Z.wnext=0,inflateResetKeep(N)},inflateReset2=(N,Z)=>{let q;if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const J=N.state;return Z<0?(q=0,Z=-Z):(q=(Z>>4)+5,Z<48&&(Z&=15)),Z&&(Z<8||Z>15)?Z_STREAM_ERROR$1:(J.window!==null&&J.wbits!==Z&&(J.window=null),J.wrap=q,J.wbits=Z,inflateReset(N))},inflateInit2=(N,Z)=>{if(!N)return Z_STREAM_ERROR$1;const q=new InflateState;N.state=q,q.strm=N,q.window=null,q.mode=HEAD;const J=inflateReset2(N,Z);return J!==Z_OK$1&&(N.state=null),J},inflateInit=N=>inflateInit2(N,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=N=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let Z=0;for(;Z<144;)N.lens[Z++]=8;for(;Z<256;)N.lens[Z++]=9;for(;Z<280;)N.lens[Z++]=7;for(;Z<288;)N.lens[Z++]=8;for(inftrees(LENS,N.lens,0,288,lenfix,0,N.work,{bits:9}),Z=0;Z<32;)N.lens[Z++]=5;inftrees(DISTS,N.lens,0,32,distfix,0,N.work,{bits:5}),virgin=!1}N.lencode=lenfix,N.lenbits=9,N.distcode=distfix,N.distbits=5},updatewindow=(N,Z,q,J)=>{let I;const D=N.state;return D.window===null&&(D.wsize=1<<D.wbits,D.wnext=0,D.whave=0,D.window=new Uint8Array(D.wsize)),J>=D.wsize?(D.window.set(Z.subarray(q-D.wsize,q),0),D.wnext=0,D.whave=D.wsize):(I=D.wsize-D.wnext,I>J&&(I=J),D.window.set(Z.subarray(q-J,q-J+I),D.wnext),J-=I,J?(D.window.set(Z.subarray(q-J,q),0),D.wnext=J,D.whave=D.wsize):(D.wnext+=I,D.wnext===D.wsize&&(D.wnext=0),D.whave<D.wsize&&(D.whave+=I))),0},inflate$2=(N,Z)=>{let q,J,I,D,a,O,F,z,K,te,ne,ee,re,ce,oe=0,se,fe,ge,ue,_e,pe,ye,we;const Ie=new Uint8Array(4);let be,Se;const Me=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(N)||!N.output||!N.input&&N.avail_in!==0)return Z_STREAM_ERROR$1;q=N.state,q.mode===TYPE&&(q.mode=TYPEDO),a=N.next_out,I=N.output,F=N.avail_out,D=N.next_in,J=N.input,O=N.avail_in,z=q.hold,K=q.bits,te=O,ne=F,we=Z_OK$1;e:for(;;)switch(q.mode){case HEAD:if(q.wrap===0){q.mode=TYPEDO;break}for(;K<16;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(q.wrap&2&&z===35615){q.wbits===0&&(q.wbits=15),q.check=0,Ie[0]=z&255,Ie[1]=z>>>8&255,q.check=crc32_1(q.check,Ie,2,0),z=0,K=0,q.mode=FLAGS;break}if(q.head&&(q.head.done=!1),!(q.wrap&1)||(((z&255)<<8)+(z>>8))%31){N.msg="incorrect header check",q.mode=BAD;break}if((z&15)!==Z_DEFLATED){N.msg="unknown compression method",q.mode=BAD;break}if(z>>>=4,K-=4,ye=(z&15)+8,q.wbits===0&&(q.wbits=ye),ye>15||ye>q.wbits){N.msg="invalid window size",q.mode=BAD;break}q.dmax=1<<q.wbits,q.flags=0,N.adler=q.check=1,q.mode=z&512?DICTID:TYPE,z=0,K=0;break;case FLAGS:for(;K<16;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(q.flags=z,(q.flags&255)!==Z_DEFLATED){N.msg="unknown compression method",q.mode=BAD;break}if(q.flags&57344){N.msg="unknown header flags set",q.mode=BAD;break}q.head&&(q.head.text=z>>8&1),q.flags&512&&q.wrap&4&&(Ie[0]=z&255,Ie[1]=z>>>8&255,q.check=crc32_1(q.check,Ie,2,0)),z=0,K=0,q.mode=TIME;case TIME:for(;K<32;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.head&&(q.head.time=z),q.flags&512&&q.wrap&4&&(Ie[0]=z&255,Ie[1]=z>>>8&255,Ie[2]=z>>>16&255,Ie[3]=z>>>24&255,q.check=crc32_1(q.check,Ie,4,0)),z=0,K=0,q.mode=OS;case OS:for(;K<16;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.head&&(q.head.xflags=z&255,q.head.os=z>>8),q.flags&512&&q.wrap&4&&(Ie[0]=z&255,Ie[1]=z>>>8&255,q.check=crc32_1(q.check,Ie,2,0)),z=0,K=0,q.mode=EXLEN;case EXLEN:if(q.flags&1024){for(;K<16;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.length=z,q.head&&(q.head.extra_len=z),q.flags&512&&q.wrap&4&&(Ie[0]=z&255,Ie[1]=z>>>8&255,q.check=crc32_1(q.check,Ie,2,0)),z=0,K=0}else q.head&&(q.head.extra=null);q.mode=EXTRA;case EXTRA:if(q.flags&1024&&(ee=q.length,ee>O&&(ee=O),ee&&(q.head&&(ye=q.head.extra_len-q.length,q.head.extra||(q.head.extra=new Uint8Array(q.head.extra_len)),q.head.extra.set(J.subarray(D,D+ee),ye)),q.flags&512&&q.wrap&4&&(q.check=crc32_1(q.check,J,ee,D)),O-=ee,D+=ee,q.length-=ee),q.length))break e;q.length=0,q.mode=NAME;case NAME:if(q.flags&2048){if(O===0)break e;ee=0;do ye=J[D+ee++],q.head&&ye&&q.length<65536&&(q.head.name+=String.fromCharCode(ye));while(ye&&ee<O);if(q.flags&512&&q.wrap&4&&(q.check=crc32_1(q.check,J,ee,D)),O-=ee,D+=ee,ye)break e}else q.head&&(q.head.name=null);q.length=0,q.mode=COMMENT;case COMMENT:if(q.flags&4096){if(O===0)break e;ee=0;do ye=J[D+ee++],q.head&&ye&&q.length<65536&&(q.head.comment+=String.fromCharCode(ye));while(ye&&ee<O);if(q.flags&512&&q.wrap&4&&(q.check=crc32_1(q.check,J,ee,D)),O-=ee,D+=ee,ye)break e}else q.head&&(q.head.comment=null);q.mode=HCRC;case HCRC:if(q.flags&512){for(;K<16;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(q.wrap&4&&z!==(q.check&65535)){N.msg="header crc mismatch",q.mode=BAD;break}z=0,K=0}q.head&&(q.head.hcrc=q.flags>>9&1,q.head.done=!0),N.adler=q.check=0,q.mode=TYPE;break;case DICTID:for(;K<32;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}N.adler=q.check=zswap32(z),z=0,K=0,q.mode=DICT;case DICT:if(q.havedict===0)return N.next_out=a,N.avail_out=F,N.next_in=D,N.avail_in=O,q.hold=z,q.bits=K,Z_NEED_DICT$1;N.adler=q.check=1,q.mode=TYPE;case TYPE:if(Z===Z_BLOCK||Z===Z_TREES)break e;case TYPEDO:if(q.last){z>>>=K&7,K-=K&7,q.mode=CHECK;break}for(;K<3;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}switch(q.last=z&1,z>>>=1,K-=1,z&3){case 0:q.mode=STORED;break;case 1:if(fixedtables(q),q.mode=LEN_,Z===Z_TREES){z>>>=2,K-=2;break e}break;case 2:q.mode=TABLE;break;case 3:N.msg="invalid block type",q.mode=BAD}z>>>=2,K-=2;break;case STORED:for(z>>>=K&7,K-=K&7;K<32;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if((z&65535)!==(z>>>16^65535)){N.msg="invalid stored block lengths",q.mode=BAD;break}if(q.length=z&65535,z=0,K=0,q.mode=COPY_,Z===Z_TREES)break e;case COPY_:q.mode=COPY;case COPY:if(ee=q.length,ee){if(ee>O&&(ee=O),ee>F&&(ee=F),ee===0)break e;I.set(J.subarray(D,D+ee),a),O-=ee,D+=ee,F-=ee,a+=ee,q.length-=ee;break}q.mode=TYPE;break;case TABLE:for(;K<14;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(q.nlen=(z&31)+257,z>>>=5,K-=5,q.ndist=(z&31)+1,z>>>=5,K-=5,q.ncode=(z&15)+4,z>>>=4,K-=4,q.nlen>286||q.ndist>30){N.msg="too many length or distance symbols",q.mode=BAD;break}q.have=0,q.mode=LENLENS;case LENLENS:for(;q.have<q.ncode;){for(;K<3;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.lens[Me[q.have++]]=z&7,z>>>=3,K-=3}for(;q.have<19;)q.lens[Me[q.have++]]=0;if(q.lencode=q.lendyn,q.lenbits=7,be={bits:q.lenbits},we=inftrees(CODES,q.lens,0,19,q.lencode,0,q.work,be),q.lenbits=be.bits,we){N.msg="invalid code lengths set",q.mode=BAD;break}q.have=0,q.mode=CODELENS;case CODELENS:for(;q.have<q.nlen+q.ndist;){for(;oe=q.lencode[z&(1<<q.lenbits)-1],se=oe>>>24,fe=oe>>>16&255,ge=oe&65535,!(se<=K);){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(ge<16)z>>>=se,K-=se,q.lens[q.have++]=ge;else{if(ge===16){for(Se=se+2;K<Se;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(z>>>=se,K-=se,q.have===0){N.msg="invalid bit length repeat",q.mode=BAD;break}ye=q.lens[q.have-1],ee=3+(z&3),z>>>=2,K-=2}else if(ge===17){for(Se=se+3;K<Se;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}z>>>=se,K-=se,ye=0,ee=3+(z&7),z>>>=3,K-=3}else{for(Se=se+7;K<Se;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}z>>>=se,K-=se,ye=0,ee=11+(z&127),z>>>=7,K-=7}if(q.have+ee>q.nlen+q.ndist){N.msg="invalid bit length repeat",q.mode=BAD;break}for(;ee--;)q.lens[q.have++]=ye}}if(q.mode===BAD)break;if(q.lens[256]===0){N.msg="invalid code -- missing end-of-block",q.mode=BAD;break}if(q.lenbits=9,be={bits:q.lenbits},we=inftrees(LENS,q.lens,0,q.nlen,q.lencode,0,q.work,be),q.lenbits=be.bits,we){N.msg="invalid literal/lengths set",q.mode=BAD;break}if(q.distbits=6,q.distcode=q.distdyn,be={bits:q.distbits},we=inftrees(DISTS,q.lens,q.nlen,q.ndist,q.distcode,0,q.work,be),q.distbits=be.bits,we){N.msg="invalid distances set",q.mode=BAD;break}if(q.mode=LEN_,Z===Z_TREES)break e;case LEN_:q.mode=LEN;case LEN:if(O>=6&&F>=258){N.next_out=a,N.avail_out=F,N.next_in=D,N.avail_in=O,q.hold=z,q.bits=K,inffast(N,ne),a=N.next_out,I=N.output,F=N.avail_out,D=N.next_in,J=N.input,O=N.avail_in,z=q.hold,K=q.bits,q.mode===TYPE&&(q.back=-1);break}for(q.back=0;oe=q.lencode[z&(1<<q.lenbits)-1],se=oe>>>24,fe=oe>>>16&255,ge=oe&65535,!(se<=K);){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(fe&&(fe&240)===0){for(ue=se,_e=fe,pe=ge;oe=q.lencode[pe+((z&(1<<ue+_e)-1)>>ue)],se=oe>>>24,fe=oe>>>16&255,ge=oe&65535,!(ue+se<=K);){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}z>>>=ue,K-=ue,q.back+=ue}if(z>>>=se,K-=se,q.back+=se,q.length=ge,fe===0){q.mode=LIT;break}if(fe&32){q.back=-1,q.mode=TYPE;break}if(fe&64){N.msg="invalid literal/length code",q.mode=BAD;break}q.extra=fe&15,q.mode=LENEXT;case LENEXT:if(q.extra){for(Se=q.extra;K<Se;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.length+=z&(1<<q.extra)-1,z>>>=q.extra,K-=q.extra,q.back+=q.extra}q.was=q.length,q.mode=DIST;case DIST:for(;oe=q.distcode[z&(1<<q.distbits)-1],se=oe>>>24,fe=oe>>>16&255,ge=oe&65535,!(se<=K);){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if((fe&240)===0){for(ue=se,_e=fe,pe=ge;oe=q.distcode[pe+((z&(1<<ue+_e)-1)>>ue)],se=oe>>>24,fe=oe>>>16&255,ge=oe&65535,!(ue+se<=K);){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}z>>>=ue,K-=ue,q.back+=ue}if(z>>>=se,K-=se,q.back+=se,fe&64){N.msg="invalid distance code",q.mode=BAD;break}q.offset=ge,q.extra=fe&15,q.mode=DISTEXT;case DISTEXT:if(q.extra){for(Se=q.extra;K<Se;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}q.offset+=z&(1<<q.extra)-1,z>>>=q.extra,K-=q.extra,q.back+=q.extra}if(q.offset>q.dmax){N.msg="invalid distance too far back",q.mode=BAD;break}q.mode=MATCH;case MATCH:if(F===0)break e;if(ee=ne-F,q.offset>ee){if(ee=q.offset-ee,ee>q.whave&&q.sane){N.msg="invalid distance too far back",q.mode=BAD;break}ee>q.wnext?(ee-=q.wnext,re=q.wsize-ee):re=q.wnext-ee,ee>q.length&&(ee=q.length),ce=q.window}else ce=I,re=a-q.offset,ee=q.length;ee>F&&(ee=F),F-=ee,q.length-=ee;do I[a++]=ce[re++];while(--ee);q.length===0&&(q.mode=LEN);break;case LIT:if(F===0)break e;I[a++]=q.length,F--,q.mode=LEN;break;case CHECK:if(q.wrap){for(;K<32;){if(O===0)break e;O--,z|=J[D++]<<K,K+=8}if(ne-=F,N.total_out+=ne,q.total+=ne,q.wrap&4&&ne&&(N.adler=q.check=q.flags?crc32_1(q.check,I,ne,a-ne):adler32_1(q.check,I,ne,a-ne)),ne=F,q.wrap&4&&(q.flags?z:zswap32(z))!==q.check){N.msg="incorrect data check",q.mode=BAD;break}z=0,K=0}q.mode=LENGTH;case LENGTH:if(q.wrap&&q.flags){for(;K<32;){if(O===0)break e;O--,z+=J[D++]<<K,K+=8}if(q.wrap&4&&z!==(q.total&4294967295)){N.msg="incorrect length check",q.mode=BAD;break}z=0,K=0}q.mode=DONE;case DONE:we=Z_STREAM_END$1;break e;case BAD:we=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return N.next_out=a,N.avail_out=F,N.next_in=D,N.avail_in=O,q.hold=z,q.bits=K,(q.wsize||ne!==N.avail_out&&q.mode<BAD&&(q.mode<CHECK||Z!==Z_FINISH$1))&&updatewindow(N,N.output,N.next_out,ne-N.avail_out),te-=N.avail_in,ne-=N.avail_out,N.total_in+=te,N.total_out+=ne,q.total+=ne,q.wrap&4&&ne&&(N.adler=q.check=q.flags?crc32_1(q.check,I,ne,N.next_out-ne):adler32_1(q.check,I,ne,N.next_out-ne)),N.data_type=q.bits+(q.last?64:0)+(q.mode===TYPE?128:0)+(q.mode===LEN_||q.mode===COPY_?256:0),(te===0&&ne===0||Z===Z_FINISH$1)&&we===Z_OK$1&&(we=Z_BUF_ERROR),we},inflateEnd=N=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;let Z=N.state;return Z.window&&(Z.window=null),N.state=null,Z_OK$1},inflateGetHeader=(N,Z)=>{if(inflateStateCheck(N))return Z_STREAM_ERROR$1;const q=N.state;return(q.wrap&2)===0?Z_STREAM_ERROR$1:(q.head=Z,Z.done=!1,Z_OK$1)},inflateSetDictionary=(N,Z)=>{const q=Z.length;let J,I,D;return inflateStateCheck(N)||(J=N.state,J.wrap!==0&&J.mode!==DICT)?Z_STREAM_ERROR$1:J.mode===DICT&&(I=1,I=adler32_1(I,Z,q,0),I!==J.check)?Z_DATA_ERROR$1:(D=updatewindow(N,Z,q,q),D?(J.mode=MEM,Z_MEM_ERROR$1):(J.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(N){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},N||{});const Z=this.options;Z.raw&&Z.windowBits>=0&&Z.windowBits<16&&(Z.windowBits=-Z.windowBits,Z.windowBits===0&&(Z.windowBits=-15)),Z.windowBits>=0&&Z.windowBits<16&&!(N&&N.windowBits)&&(Z.windowBits+=32),Z.windowBits>15&&Z.windowBits<48&&(Z.windowBits&15)===0&&(Z.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let q=inflate_1$2.inflateInit2(this.strm,Z.windowBits);if(q!==Z_OK)throw new Error(messages[q]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),Z.dictionary&&(typeof Z.dictionary=="string"?Z.dictionary=strings.string2buf(Z.dictionary):toString.call(Z.dictionary)==="[object ArrayBuffer]"&&(Z.dictionary=new Uint8Array(Z.dictionary)),Z.raw&&(q=inflate_1$2.inflateSetDictionary(this.strm,Z.dictionary),q!==Z_OK)))throw new Error(messages[q])}Inflate$1.prototype.push=function(N,Z){const q=this.strm,J=this.options.chunkSize,I=this.options.dictionary;let D,a,O;if(this.ended)return!1;for(Z===~~Z?a=Z:a=Z===!0?Z_FINISH:Z_NO_FLUSH,toString.call(N)==="[object ArrayBuffer]"?q.input=new Uint8Array(N):q.input=N,q.next_in=0,q.avail_in=q.input.length;;){for(q.avail_out===0&&(q.output=new Uint8Array(J),q.next_out=0,q.avail_out=J),D=inflate_1$2.inflate(q,a),D===Z_NEED_DICT&&I&&(D=inflate_1$2.inflateSetDictionary(q,I),D===Z_OK?D=inflate_1$2.inflate(q,a):D===Z_DATA_ERROR&&(D=Z_NEED_DICT));q.avail_in>0&&D===Z_STREAM_END&&q.state.wrap>0&&N[q.next_in]!==0;)inflate_1$2.inflateReset(q),D=inflate_1$2.inflate(q,a);switch(D){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(D),this.ended=!0,!1}if(O=q.avail_out,q.next_out&&(q.avail_out===0||D===Z_STREAM_END))if(this.options.to==="string"){let F=strings.utf8border(q.output,q.next_out),z=q.next_out-F,K=strings.buf2string(q.output,F);q.next_out=z,q.avail_out=J-z,z&&q.output.set(q.output.subarray(F,F+z),0),this.onData(K)}else this.onData(q.output.length===q.next_out?q.output:q.output.subarray(0,q.next_out));if(!(D===Z_OK&&O===0)){if(D===Z_STREAM_END)return D=inflate_1$2.inflateEnd(this.strm),this.onEnd(D),this.ended=!0,!0;if(q.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(N){this.chunks.push(N)},Inflate$1.prototype.onEnd=function(N){N===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=N,this.msg=this.strm.msg};function inflate$1(N,Z){const q=new Inflate$1(Z);if(q.push(N),q.err)throw q.msg||messages[q.err];return q.result}function inflateRaw$1(N,Z){return Z=Z||{},Z.raw=!0,inflate$1(N,Z)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const noLogEvents=["updateSeverTime"];noLogEvents.push("heartbeat"),noLogEvents.push("heartbeatEx"),noLogEvents.push("networkQualityChange"),noLogEvents.push("onNetQuality"),noLogEvents.push("updateCall"),noLogEvents.push("pubNotify");const compressArrayBuffer=N=>{const Z=new Uint8Array(N),q=pako.deflate(Z,{gzip:!0});return new Uint8Array(q==null?void 0:q.buffer)},decompressArrayBuffer=N=>{const Z=new Uint8Array(N),q=pako.inflate(Z,{gzip:!0});return new Uint8Array(q==null?void 0:q.buffer)},sendMessageFormat=N=>{const{event:Z}=N;switch(N.data_original=N.data,N.time&&(N.timeStr=E$1(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),Z){case"login":N.data=com.quick.voice.proto.Login.encode(N.data).finish();break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinReq.encode(N.data).finish();break;case"quitRoom":N.data=com.quick.voice.proto.QuitReq.encode(N.data).finish();break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"publish":N.data=com.quick.voice.proto.PublishReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishReq.encode(N.data).finish();break;case"subscribe":N.data=com.quick.voice.proto.SubscribeReq.encode(N.data).finish();break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(N.data).finish();break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"renegotiate":N.data=com.quick.voice.proto.RenegotiateReq.encode(N.data).finish(),N.data=compressArrayBuffer(N.data),N.compress=!0;break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoReq.encode(N.data).finish();break;case"updateCall":N.data=com.quick.voice.proto.UpdateCall.encode(N.data).finish();break;case"networkQualityChange":N.data=com.quick.voice.proto.NetQualityChange.encode(N.data).finish();break;case"pubNotify":N.data=com.quick.voice.proto.PublishNotify.encode(N.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(N.data).finish();break;default:N.data=new Uint8Array;break}return N},onMessageFormat=N=>{const{event:Z,compress:q=!1}=N;if(N.data_remote=N.data,N.time&&(N.timeStr=E$1(N.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),q)try{N.data=decompressArrayBuffer(N.data)}catch(J){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",J)}switch(Z){case"login":N.data=com.quick.voice.proto.Login.decode(N.data);break;case"joinRoom":case"joinRoomEx":N.data=com.quick.voice.proto.JoinRsp.decode(N.data);break;case"onJoinRoom":N.data=com.quick.voice.proto.JoinNotify.decode(N.data);break;case"onQuitRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"connectCF":N.data=com.quick.voice.proto.ConnectCFRsp.decode(N.data);break;case"publish":N.data=com.quick.voice.proto.PublishRsp.decode(N.data);break;case"pubChannel":N.data=com.quick.voice.proto.ChannelPublishRsq.decode(N.data);break;case"onPublish":N.data=com.quick.voice.proto.PublishNotify.decode(N.data);break;case"subscribe":N.data=com.quick.voice.proto.SubscribeRsp.decode(N.data);break;case"subChannel":N.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(N.data);break;case"closeTrack":N.data=com.quick.voice.proto.CloseTrackRsp.decode(N.data);break;case"onCloseTrack":N.data=com.quick.voice.proto.CloseTrackNotify.decode(N.data);break;case"onUpdateCall":N.data=com.quick.voice.proto.UpdateCall.decode(N.data);break;case"onDataChannelPublish":N.data=com.quick.voice.proto.UserChannel.decode(N.data);break;case"onDestroyRoom":N.data=com.quick.voice.proto.QuitNotify.decode(N.data);break;case"onUpdatePermissions":N.data=com.quick.voice.proto.UpdatePermissions.decode(N.data);break;case"onNetQuality":N.data=com.quick.voice.proto.NetQualityNotify.decode(N.data);break;case"syncRoomInfo":N.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(N.data);break;case"onCDNPlayUrlAdd":N.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(N.data);break;case"onUpdateBehavior":N.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(N.data);break;case"debugger":N.data=JSON.parse(new TextDecoder().decode(N.data));break}return N};class CallsWebSocket{constructor(Z){at(this,bt);at(this,mt,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});at(this,qt,"");at(this,Jt,{});at(this,Yt,{});Ee(this,"state","closed");Ee(this,"sendMessageBefore",async()=>{});Ee(this,"onReconnectSuccess",Z=>{});Ee(this,"onReconnectStop",Z=>{});at(this,Dn,Z=>{let q=!0;const{code:J=1e3}=Z;return(J===1e3||J===4e3)&&(q=!1),this.state="connecting",q});at(this,Bn,async Z=>{De(this,mt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",Z),this.state="connected",this.onReconnectSuccess(Z)});at(this,Nn,async Z=>{De(this,mt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",Z),this.close(),this.onReconnectStop(Z)});at(this,En,(Z,q={})=>{try{const{time:J,event:I,data:D={},data_original:a={},data_remote:O,...F}=q,z=E$1(J,"YYYY-MM-DD hh:mm:ss",{offset:480});let K={};const te=(ge={})=>{const ue=JSON.parse(JSON.stringify(ge)),_e=Object.keys(ue);for(const pe of _e)(pe.includes("sdp")||pe.includes("Sdp"))&&(ue[pe]="");return ue};let ne="res ↓";switch(Z){case"res":ne="res ↓",K=te(D);break;case"req":ne="req ↑",K=te(a);break}let ee="#quickvo.logs";ignoreEvent.includes(I)&&(ee="#quickvo.ignoreEvents");const re={"#action":ne,timeStr:z,event:I,data:K,time:J,...F},ce=localStorage.getItem(ee)||JSON.stringify([]),oe=JSON.parse(ce);let se=I==="heartbeat";const fe=[re];for(const ge of oe){const{event:ue}=ge;if(ue==="heartbeat"){if(se)continue;se=!0}if(fe.length===200)break;fe.push(ge)}localStorage.setItem(ee,JSON.stringify(fe))}catch(J){De(this,mt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",J)}});at(this,Mn,(Z,{resolve:q,reject:J})=>{const{sn:I=""}=Z,D=()=>{const O=De(this,Jt)[I];clearTimeout(O.destructionTimer),delete De(this,Jt)[I]},a=window.setTimeout(()=>{const O=De(this,Jt)[I];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",O.message),D(),J("event is timeout")},De(this,mt).timeout);De(this,Jt)[I]={message:Z,resolve:q,reject:J,destruction:D,destructionTimer:a}});at(this,qn,Z=>De(this,Jt)[Z]);at(this,Pn,async Z=>{const q=new Uint8Array(Z),J=com.quick.voice.proto.CommonRsp.decode(q),{sn:I,event:D}=J,a=onMessageFormat(J);if(De(this,mt).debug&&(noLogEvents.includes(D)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",a),ignoreEvent.includes(D)||De(this,En).call(this,"res",a)),notifyName_keys.includes(D))return this.emitNotify(D,P(a,["code","data","desc"]));const F=De(this,qn).call(this,I);if(F){const{resolve:z=te=>{},destruction:K=()=>{}}=F;z(P(a,["code","data","desc"])),K()}});Ee(this,"clearEvents",(Z=[])=>{const q=Object.keys(De(this,Jt));Z.length===0&&(Z=q);for(const J of q){if(!Z.includes(J))continue;const I=De(this,Jt)[J];if(I){const{destruction:D}=I;D()}}});Ee(this,"connect",async(Z="")=>new Promise(async q=>{Z&&Ct(this,qt,Z),De(this,bt)&&(await De(this,bt).close(),this.state="closed");const J=`${De(this,mt).url}?s=${De(this,qt)}&t=${Date.now()}`,I=new Date().getTime();if(Ct(this,bt,new M({...De(this,mt),debug:!1,url:J,binaryType:"arraybuffer",onMessage:De(this,Pn),checkReconnect:De(this,Dn),getHeartbeatMsg:()=>"",onReconnectSuccess:De(this,Bn),onReconnectStop:De(this,Nn)})),this.state="connecting",await De(this,bt).connect(),this.state="connected",De(this,mt).debug){const a=new Date().getTime()-I;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${a}ms-广播事件`,De(this,Yt))}q(De(this,bt))}));Ee(this,"close",async()=>{var q;De(this,mt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const Z=Object.keys(De(this,Jt));for(const J of Z){const{destructionTimer:I}=De(this,Jt)[J];clearTimeout(I)}Ct(this,Jt,{}),await((q=De(this,bt))==null?void 0:q.close()),this.state="closed"});Ee(this,"sendMessage",(Z,q=!0)=>new Promise(async(J,I)=>{var K;await this.sendMessageBefore();const{event:D,...a}=Z,O=Date.now(),F=sendMessageFormat({event:D,sn:+`${O}${v$1(1e3,9999)}`,time:O,valid:De(this,mt).timeout,version:1,compress:!1,...a});De(this,mt).debug&&(noLogEvents.includes(D)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",F),ignoreEvent.includes(D)||De(this,En).call(this,"req",F)),q&&De(this,Mn).call(this,F,{resolve:J,reject:I});const z=com.quick.voice.proto.CommonReq.encode(F).finish();(K=De(this,bt))==null||K.sendMessage(z)}));Ee(this,"emitNotify",async(Z,q)=>{const J=De(this,Yt)[Z]||[];for(const I of J){const{callback:D=async()=>{}}=I;await D(q)}});Ee(this,"addNotify",(Z,q=!1)=>{const{event:J,sn:I=xt(32)}=Z;De(this,Yt)[J]||(De(this,Yt)[J]=[]);const D=De(this,Yt)[J],a=D.findIndex(O=>O.sn===I);return a!==-1&&D.splice(a,1),q?D.unshift(Z):D.push(Z),I});Ee(this,"removeNotify",(Z=[])=>{if(Z.length===0)Ct(this,Yt,{});else{const q=Object.keys(De(this,Yt));for(const J of q)De(this,Yt)[J]=De(this,Yt)[J].filter(I=>!Z.includes(I.sn||""))}De(this,mt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",De(this,Yt))});Ct(this,mt,{...De(this,mt),...Z})}}bt=new WeakMap,mt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Yt=new WeakMap,Dn=new WeakMap,Bn=new WeakMap,Nn=new WeakMap,En=new WeakMap,Mn=new WeakMap,qn=new WeakMap,Pn=new WeakMap;/*! For license information please see pikazLocationModule.js.LICENSE.txt */var e$2={782:function(N){N.exports=(()=>{var Z={483:(I,D,a)=>{I.exports=function O(F,z,K){function te(re,ce){if(!z[re]){if(!F[re]){if(ne)return ne(re,!0);var oe=new Error("Cannot find module '"+re+"'");throw oe.code="MODULE_NOT_FOUND",oe}var se=z[re]={exports:{}};F[re][0].call(se.exports,function(fe){return te(F[re][1][fe]||fe)},se,se.exports,O,F,z,K)}return z[re].exports}for(var ne=void 0,ee=0;ee<K.length;ee++)te(K[ee]);return te}({1:[function(O,F,z){(function(K){var te,ne,ee=K.MutationObserver||K.WebKitMutationObserver;if(ee){var re=0,ce=new ee(ge),oe=K.document.createTextNode("");ce.observe(oe,{characterData:!0}),te=function(){oe.data=re=++re%2}}else if(K.setImmediate||K.MessageChannel===void 0)te="document"in K&&"onreadystatechange"in K.document.createElement("script")?function(){var ue=K.document.createElement("script");ue.onreadystatechange=function(){ge(),ue.onreadystatechange=null,ue.parentNode.removeChild(ue),ue=null},K.document.documentElement.appendChild(ue)}:function(){setTimeout(ge,0)};else{var se=new K.MessageChannel;se.port1.onmessage=ge,te=function(){se.port2.postMessage(0)}}var fe=[];function ge(){var ue,_e;ne=!0;for(var pe=fe.length;pe;){for(_e=fe,fe=[],ue=-1;++ue<pe;)_e[ue]();pe=fe.length}ne=!1}F.exports=function(ue){fe.push(ue)!==1||ne||te()}}).call(this,a.g!==void 0?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(O,F,z){var K=O(1);function te(){}var ne={},ee=["REJECTED"],re=["FULFILLED"],ce=["PENDING"];function oe(pe){if(typeof pe!="function")throw new TypeError("resolver must be a function");this.state=ce,this.queue=[],this.outcome=void 0,pe!==te&&ue(this,pe)}function se(pe,ye,we){this.promise=pe,typeof ye=="function"&&(this.onFulfilled=ye,this.callFulfilled=this.otherCallFulfilled),typeof we=="function"&&(this.onRejected=we,this.callRejected=this.otherCallRejected)}function fe(pe,ye,we){K(function(){var Ie;try{Ie=ye(we)}catch(be){return ne.reject(pe,be)}Ie===pe?ne.reject(pe,new TypeError("Cannot resolve promise with itself")):ne.resolve(pe,Ie)})}function ge(pe){var ye=pe&&pe.then;if(pe&&(typeof pe=="object"||typeof pe=="function")&&typeof ye=="function")return function(){ye.apply(pe,arguments)}}function ue(pe,ye){var we=!1;function Ie(Me){we||(we=!0,ne.reject(pe,Me))}function be(Me){we||(we=!0,ne.resolve(pe,Me))}var Se=_e(function(){ye(be,Ie)});Se.status==="error"&&Ie(Se.value)}function _e(pe,ye){var we={};try{we.value=pe(ye),we.status="success"}catch(Ie){we.status="error",we.value=Ie}return we}F.exports=oe,oe.prototype.catch=function(pe){return this.then(null,pe)},oe.prototype.then=function(pe,ye){if(typeof pe!="function"&&this.state===re||typeof ye!="function"&&this.state===ee)return this;var we=new this.constructor(te);return this.state!==ce?fe(we,this.state===re?pe:ye,this.outcome):this.queue.push(new se(we,pe,ye)),we},se.prototype.callFulfilled=function(pe){ne.resolve(this.promise,pe)},se.prototype.otherCallFulfilled=function(pe){fe(this.promise,this.onFulfilled,pe)},se.prototype.callRejected=function(pe){ne.reject(this.promise,pe)},se.prototype.otherCallRejected=function(pe){fe(this.promise,this.onRejected,pe)},ne.resolve=function(pe,ye){var we=_e(ge,ye);if(we.status==="error")return ne.reject(pe,we.value);var Ie=we.value;if(Ie)ue(pe,Ie);else{pe.state=re,pe.outcome=ye;for(var be=-1,Se=pe.queue.length;++be<Se;)pe.queue[be].callFulfilled(ye)}return pe},ne.reject=function(pe,ye){pe.state=ee,pe.outcome=ye;for(var we=-1,Ie=pe.queue.length;++we<Ie;)pe.queue[we].callRejected(ye);return pe},oe.resolve=function(pe){return pe instanceof this?pe:ne.resolve(new this(te),pe)},oe.reject=function(pe){var ye=new this(te);return ne.reject(ye,pe)},oe.all=function(pe){var ye=this;if(Object.prototype.toString.call(pe)!=="[object Array]")return this.reject(new TypeError("must be an array"));var we=pe.length,Ie=!1;if(!we)return this.resolve([]);for(var be=new Array(we),Se=0,Me=-1,We=new this(te);++Me<we;)Je(pe[Me],Me);return We;function Je(Le,Tt){ye.resolve(Le).then(function(Et){be[Tt]=Et,++Se!==we||Ie||(Ie=!0,ne.resolve(We,be))},function(Et){Ie||(Ie=!0,ne.reject(We,Et))})}},oe.race=function(pe){if(Object.prototype.toString.call(pe)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ye,we=pe.length,Ie=!1;if(!we)return this.resolve([]);for(var be=-1,Se=new this(te);++be<we;)ye=pe[be],this.resolve(ye).then(function(Me){Ie||(Ie=!0,ne.resolve(Se,Me))},function(Me){Ie||(Ie=!0,ne.reject(Se,Me))});return Se}},{1:1}],3:[function(O,F,z){(function(K){typeof K.Promise!="function"&&(K.Promise=O(2))}).call(this,a.g!==void 0?a.g:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(O,F,z){var K=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},te=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function ne(le,me){le=le||[],me=me||{};try{return new Blob(le,me)}catch(xe){if(xe.name!=="TypeError")throw xe;for(var ve=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),Re=0;Re<le.length;Re+=1)ve.append(le[Re]);return ve.getBlob(me.type)}}typeof Promise>"u"&&O(3);var ee=Promise;function re(le,me){me&&le.then(function(ve){me(null,ve)},function(ve){me(ve)})}function ce(le,me,ve){typeof me=="function"&&le.then(me),typeof ve=="function"&&le.catch(ve)}function oe(le){return typeof le!="string"&&(console.warn(le+" used as a key, but it is not a string."),le=String(le)),le}function se(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var fe="local-forage-detect-blob-support",ge=void 0,ue={},_e=Object.prototype.toString,pe="readonly",ye="readwrite";function we(le){for(var me=le.length,ve=new ArrayBuffer(me),Re=new Uint8Array(ve),xe=0;xe<me;xe++)Re[xe]=le.charCodeAt(xe);return ve}function Ie(le){return typeof ge=="boolean"?ee.resolve(ge):function(me){return new ee(function(ve){var Re=me.transaction(fe,ye),xe=ne([""]);Re.objectStore(fe).put(xe,"key"),Re.onabort=function(Ce){Ce.preventDefault(),Ce.stopPropagation(),ve(!1)},Re.oncomplete=function(){var Ce=navigator.userAgent.match(/Chrome\/(\d+)/),qe=navigator.userAgent.match(/Edge\//);ve(qe||!Ce||parseInt(Ce[1],10)>=43)}}).catch(function(){return!1})}(le).then(function(me){return ge=me})}function be(le){var me=ue[le.name],ve={};ve.promise=new ee(function(Re,xe){ve.resolve=Re,ve.reject=xe}),me.deferredOperations.push(ve),me.dbReady?me.dbReady=me.dbReady.then(function(){return ve.promise}):me.dbReady=ve.promise}function Se(le){var me=ue[le.name].deferredOperations.pop();if(me)return me.resolve(),me.promise}function Me(le,me){var ve=ue[le.name].deferredOperations.pop();if(ve)return ve.reject(me),ve.promise}function We(le,me){return new ee(function(ve,Re){if(ue[le.name]=ue[le.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},le.db){if(!me)return ve(le.db);be(le),le.db.close()}var xe=[le.name];me&&xe.push(le.version);var Ce=te.open.apply(te,xe);me&&(Ce.onupgradeneeded=function(qe){var He=Ce.result;try{He.createObjectStore(le.storeName),qe.oldVersion<=1&&He.createObjectStore(fe)}catch(ze){if(ze.name!=="ConstraintError")throw ze;console.warn('The database "'+le.name+'" has been upgraded from version '+qe.oldVersion+" to version "+qe.newVersion+', but the storage "'+le.storeName+'" already exists.')}}),Ce.onerror=function(qe){qe.preventDefault(),Re(Ce.error)},Ce.onsuccess=function(){var qe=Ce.result;qe.onversionchange=function(He){He.target.close()},ve(qe),Se(le)}})}function Je(le){return We(le,!1)}function Le(le){return We(le,!0)}function Tt(le,me){if(!le.db)return!0;var ve=!le.db.objectStoreNames.contains(le.storeName),Re=le.version<le.db.version,xe=le.version>le.db.version;if(Re&&(le.version!==me&&console.warn('The database "'+le.name+`" can't be downgraded from version `+le.db.version+" to version "+le.version+"."),le.version=le.db.version),xe||ve){if(ve){var Ce=le.db.version+1;Ce>le.version&&(le.version=Ce)}return!0}return!1}function Et(le){return ne([we(atob(le.data))],{type:le.type})}function At(le){return le&&le.__local_forage_encoded_blob}function jt(le){var me=this,ve=me._initReady().then(function(){var Re=ue[me._dbInfo.name];if(Re&&Re.dbReady)return Re.dbReady});return ce(ve,le,le),ve}function Pt(le,me,ve,Re){Re===void 0&&(Re=1);try{var xe=le.db.transaction(le.storeName,me);ve(null,xe)}catch(Ce){if(Re>0&&(!le.db||Ce.name==="InvalidStateError"||Ce.name==="NotFoundError"))return ee.resolve().then(function(){if(!le.db||Ce.name==="NotFoundError"&&!le.db.objectStoreNames.contains(le.storeName)&&le.version<=le.db.version)return le.db&&(le.version=le.db.version+1),Le(le)}).then(function(){return function(qe){be(qe);for(var He=ue[qe.name],ze=He.forages,Fe=0;Fe<ze.length;Fe++){var Ve=ze[Fe];Ve._dbInfo.db&&(Ve._dbInfo.db.close(),Ve._dbInfo.db=null)}return qe.db=null,Je(qe).then(function(Ge){return qe.db=Ge,Tt(qe)?Le(qe):Ge}).then(function(Ge){qe.db=He.db=Ge;for(var tt=0;tt<ze.length;tt++)ze[tt]._dbInfo.db=Ge}).catch(function(Ge){throw Me(qe,Ge),Ge})}(le).then(function(){Pt(le,me,ve,Re-1)})}).catch(ve);ve(Ce)}}var _t={_driver:"asyncStorage",_initStorage:function(le){var me=this,ve={db:null};if(le)for(var Re in le)ve[Re]=le[Re];var xe=ue[ve.name];xe||(xe={forages:[],db:null,dbReady:null,deferredOperations:[]},ue[ve.name]=xe),xe.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=jt);var Ce=[];function qe(){return ee.resolve()}for(var He=0;He<xe.forages.length;He++){var ze=xe.forages[He];ze!==me&&Ce.push(ze._initReady().catch(qe))}var Fe=xe.forages.slice(0);return ee.all(Ce).then(function(){return ve.db=xe.db,Je(ve)}).then(function(Ve){return ve.db=Ve,Tt(ve,me._defaultConfig.version)?Le(ve):Ve}).then(function(Ve){ve.db=xe.db=Ve,me._dbInfo=ve;for(var Ge=0;Ge<Fe.length;Ge++){var tt=Fe[Ge];tt!==me&&(tt._dbInfo.db=ve.db,tt._dbInfo.version=ve.version)}})},_support:function(){try{if(!te||!te.open)return!1;var le=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!le||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(le,me){var ve=this,Re=new ee(function(xe,Ce){ve.ready().then(function(){Pt(ve._dbInfo,pe,function(qe,He){if(qe)return Ce(qe);try{var ze=He.objectStore(ve._dbInfo.storeName).openCursor(),Fe=1;ze.onsuccess=function(){var Ve=ze.result;if(Ve){var Ge=Ve.value;At(Ge)&&(Ge=Et(Ge));var tt=le(Ge,Ve.key,Fe++);tt!==void 0?xe(tt):Ve.continue()}else xe()},ze.onerror=function(){Ce(ze.error)}}catch(Ve){Ce(Ve)}})}).catch(Ce)});return re(Re,me),Re},getItem:function(le,me){var ve=this;le=oe(le);var Re=new ee(function(xe,Ce){ve.ready().then(function(){Pt(ve._dbInfo,pe,function(qe,He){if(qe)return Ce(qe);try{var ze=He.objectStore(ve._dbInfo.storeName).get(le);ze.onsuccess=function(){var Fe=ze.result;Fe===void 0&&(Fe=null),At(Fe)&&(Fe=Et(Fe)),xe(Fe)},ze.onerror=function(){Ce(ze.error)}}catch(Fe){Ce(Fe)}})}).catch(Ce)});return re(Re,me),Re},setItem:function(le,me,ve){var Re=this;le=oe(le);var xe=new ee(function(Ce,qe){var He;Re.ready().then(function(){return He=Re._dbInfo,_e.call(me)==="[object Blob]"?Ie(He.db).then(function(ze){return ze?me:(Fe=me,new ee(function(Ve,Ge){var tt=new FileReader;tt.onerror=Ge,tt.onloadend=function(ut){var vt=btoa(ut.target.result||"");Ve({__local_forage_encoded_blob:!0,data:vt,type:Fe.type})},tt.readAsBinaryString(Fe)}));var Fe}):me}).then(function(ze){Pt(Re._dbInfo,ye,function(Fe,Ve){if(Fe)return qe(Fe);try{var Ge=Ve.objectStore(Re._dbInfo.storeName);ze===null&&(ze=void 0);var tt=Ge.put(ze,le);Ve.oncomplete=function(){ze===void 0&&(ze=null),Ce(ze)},Ve.onabort=Ve.onerror=function(){var ut=tt.error?tt.error:tt.transaction.error;qe(ut)}}catch(ut){qe(ut)}})}).catch(qe)});return re(xe,ve),xe},removeItem:function(le,me){var ve=this;le=oe(le);var Re=new ee(function(xe,Ce){ve.ready().then(function(){Pt(ve._dbInfo,ye,function(qe,He){if(qe)return Ce(qe);try{var ze=He.objectStore(ve._dbInfo.storeName).delete(le);He.oncomplete=function(){xe()},He.onerror=function(){Ce(ze.error)},He.onabort=function(){var Fe=ze.error?ze.error:ze.transaction.error;Ce(Fe)}}catch(Fe){Ce(Fe)}})}).catch(Ce)});return re(Re,me),Re},clear:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){Pt(me._dbInfo,ye,function(Ce,qe){if(Ce)return xe(Ce);try{var He=qe.objectStore(me._dbInfo.storeName).clear();qe.oncomplete=function(){Re()},qe.onabort=qe.onerror=function(){var ze=He.error?He.error:He.transaction.error;xe(ze)}}catch(ze){xe(ze)}})}).catch(xe)});return re(ve,le),ve},length:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){Pt(me._dbInfo,pe,function(Ce,qe){if(Ce)return xe(Ce);try{var He=qe.objectStore(me._dbInfo.storeName).count();He.onsuccess=function(){Re(He.result)},He.onerror=function(){xe(He.error)}}catch(ze){xe(ze)}})}).catch(xe)});return re(ve,le),ve},key:function(le,me){var ve=this,Re=new ee(function(xe,Ce){le<0?xe(null):ve.ready().then(function(){Pt(ve._dbInfo,pe,function(qe,He){if(qe)return Ce(qe);try{var ze=He.objectStore(ve._dbInfo.storeName),Fe=!1,Ve=ze.openKeyCursor();Ve.onsuccess=function(){var Ge=Ve.result;Ge?le===0||Fe?xe(Ge.key):(Fe=!0,Ge.advance(le)):xe(null)},Ve.onerror=function(){Ce(Ve.error)}}catch(Ge){Ce(Ge)}})}).catch(Ce)});return re(Re,me),Re},keys:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){Pt(me._dbInfo,pe,function(Ce,qe){if(Ce)return xe(Ce);try{var He=qe.objectStore(me._dbInfo.storeName).openKeyCursor(),ze=[];He.onsuccess=function(){var Fe=He.result;Fe?(ze.push(Fe.key),Fe.continue()):Re(ze)},He.onerror=function(){xe(He.error)}}catch(Fe){xe(Fe)}})}).catch(xe)});return re(ve,le),ve},dropInstance:function(le,me){me=se.apply(this,arguments);var ve=this.config();(le=typeof le!="function"&&le||{}).name||(le.name=le.name||ve.name,le.storeName=le.storeName||ve.storeName);var Re,xe=this;if(le.name){var Ce=le.name===ve.name&&xe._dbInfo.db?ee.resolve(xe._dbInfo.db):Je(le).then(function(qe){var He=ue[le.name],ze=He.forages;He.db=qe;for(var Fe=0;Fe<ze.length;Fe++)ze[Fe]._dbInfo.db=qe;return qe});Re=le.storeName?Ce.then(function(qe){if(qe.objectStoreNames.contains(le.storeName)){var He=qe.version+1;be(le);var ze=ue[le.name],Fe=ze.forages;qe.close();for(var Ve=0;Ve<Fe.length;Ve++){var Ge=Fe[Ve];Ge._dbInfo.db=null,Ge._dbInfo.version=He}var tt=new ee(function(ut,vt){var Mt=te.open(le.name,He);Mt.onerror=function(on){Mt.result.close(),vt(on)},Mt.onupgradeneeded=function(){Mt.result.deleteObjectStore(le.storeName)},Mt.onsuccess=function(){var on=Mt.result;on.close(),ut(on)}});return tt.then(function(ut){ze.db=ut;for(var vt=0;vt<Fe.length;vt++){var Mt=Fe[vt];Mt._dbInfo.db=ut,Se(Mt._dbInfo)}}).catch(function(ut){throw(Me(le,ut)||ee.resolve()).catch(function(){}),ut})}}):Ce.then(function(qe){be(le);var He=ue[le.name],ze=He.forages;qe.close();for(var Fe=0;Fe<ze.length;Fe++)ze[Fe]._dbInfo.db=null;var Ve=new ee(function(Ge,tt){var ut=te.deleteDatabase(le.name);ut.onerror=function(){var vt=ut.result;vt&&vt.close(),tt(ut.error)},ut.onblocked=function(){console.warn('dropInstance blocked for database "'+le.name+'" until all open connections are closed')},ut.onsuccess=function(){var vt=ut.result;vt&&vt.close(),Ge(vt)}});return Ve.then(function(Ge){He.db=Ge;for(var tt=0;tt<ze.length;tt++)Se(ze[tt]._dbInfo)}).catch(function(Ge){throw(Me(le,Ge)||ee.resolve()).catch(function(){}),Ge})})}else Re=ee.reject("Invalid arguments");return re(Re,me),Re}},rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vt=/^~~local_forage_type~([^~]+)~/,Rt="__lfsc__:",Pe=Rt.length,it="arbf",zt="blob",Bt="si08",nt="ui08",et="uic8",ot="si16",st="si32",gt="ur16",Dt="ui32",Ut="fl32",Lt="fl64",Zt=Pe+it.length,Kt=Object.prototype.toString;function fn(le){var me,ve,Re,xe,Ce,qe=.75*le.length,He=le.length,ze=0;le[le.length-1]==="="&&(qe--,le[le.length-2]==="="&&qe--);var Fe=new ArrayBuffer(qe),Ve=new Uint8Array(Fe);for(me=0;me<He;me+=4)ve=rt.indexOf(le[me]),Re=rt.indexOf(le[me+1]),xe=rt.indexOf(le[me+2]),Ce=rt.indexOf(le[me+3]),Ve[ze++]=ve<<2|Re>>4,Ve[ze++]=(15&Re)<<4|xe>>2,Ve[ze++]=(3&xe)<<6|63&Ce;return Fe}function tn(le){var me,ve=new Uint8Array(le),Re="";for(me=0;me<ve.length;me+=3)Re+=rt[ve[me]>>2],Re+=rt[(3&ve[me])<<4|ve[me+1]>>4],Re+=rt[(15&ve[me+1])<<2|ve[me+2]>>6],Re+=rt[63&ve[me+2]];return ve.length%3==2?Re=Re.substring(0,Re.length-1)+"=":ve.length%3==1&&(Re=Re.substring(0,Re.length-2)+"=="),Re}var nn={serialize:function(le,me){var ve="";if(le&&(ve=Kt.call(le)),le&&(ve==="[object ArrayBuffer]"||le.buffer&&Kt.call(le.buffer)==="[object ArrayBuffer]")){var Re,xe=Rt;le instanceof ArrayBuffer?(Re=le,xe+=it):(Re=le.buffer,ve==="[object Int8Array]"?xe+=Bt:ve==="[object Uint8Array]"?xe+=nt:ve==="[object Uint8ClampedArray]"?xe+=et:ve==="[object Int16Array]"?xe+=ot:ve==="[object Uint16Array]"?xe+=gt:ve==="[object Int32Array]"?xe+=st:ve==="[object Uint32Array]"?xe+=Dt:ve==="[object Float32Array]"?xe+=Ut:ve==="[object Float64Array]"?xe+=Lt:me(new Error("Failed to get type for BinaryArray"))),me(xe+tn(Re))}else if(ve==="[object Blob]"){var Ce=new FileReader;Ce.onload=function(){var qe="~~local_forage_type~"+le.type+"~"+tn(this.result);me("__lfsc__:blob"+qe)},Ce.readAsArrayBuffer(le)}else try{me(JSON.stringify(le))}catch(qe){console.error("Couldn't convert value into a JSON string: ",le),me(null,qe)}},deserialize:function(le){if(le.substring(0,Pe)!==Rt)return JSON.parse(le);var me,ve=le.substring(Zt),Re=le.substring(Pe,Zt);if(Re===zt&&Vt.test(ve)){var xe=ve.match(Vt);me=xe[1],ve=ve.substring(xe[0].length)}var Ce=fn(ve);switch(Re){case it:return Ce;case zt:return ne([Ce],{type:me});case Bt:return new Int8Array(Ce);case nt:return new Uint8Array(Ce);case et:return new Uint8ClampedArray(Ce);case ot:return new Int16Array(Ce);case gt:return new Uint16Array(Ce);case st:return new Int32Array(Ce);case Dt:return new Uint32Array(Ce);case Ut:return new Float32Array(Ce);case Lt:return new Float64Array(Ce);default:throw new Error("Unkown type: "+Re)}},stringToBuffer:fn,bufferToString:tn};function Wt(le,me,ve,Re){le.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],ve,Re)}function Gt(le,me,ve,Re,xe,Ce){le.executeSql(ve,Re,xe,function(qe,He){He.code===He.SYNTAX_ERR?qe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(ze,Fe){Fe.rows.length?Ce(ze,He):Wt(ze,me,function(){ze.executeSql(ve,Re,xe,Ce)},Ce)},Ce):Ce(qe,He)},Ce)}function _n(le,me,ve,Re){var xe=this;le=oe(le);var Ce=new ee(function(qe,He){xe.ready().then(function(){me===void 0&&(me=null);var ze=me,Fe=xe._dbInfo;Fe.serializer.serialize(me,function(Ve,Ge){Ge?He(Ge):Fe.db.transaction(function(tt){Gt(tt,Fe,"INSERT OR REPLACE INTO "+Fe.storeName+" (key, value) VALUES (?, ?)",[le,Ve],function(){qe(ze)},function(ut,vt){He(vt)})},function(tt){if(tt.code===tt.QUOTA_ERR){if(Re>0)return void qe(_n.apply(xe,[le,ze,ve,Re-1]));He(tt)}})})}).catch(He)});return re(Ce,ve),Ce}function rn(le){return new ee(function(me,ve){le.transaction(function(Re){Re.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(xe,Ce){for(var qe=[],He=0;He<Ce.rows.length;He++)qe.push(Ce.rows.item(He).name);me({db:le,storeNames:qe})},function(xe,Ce){ve(Ce)})},function(Re){ve(Re)})})}var Qt={_driver:"webSQLStorage",_initStorage:function(le){var me=this,ve={db:null};if(le)for(var Re in le)ve[Re]=typeof le[Re]!="string"?le[Re].toString():le[Re];var xe=new ee(function(Ce,qe){try{ve.db=openDatabase(ve.name,String(ve.version),ve.description,ve.size)}catch(He){return qe(He)}ve.db.transaction(function(He){Wt(He,ve,function(){me._dbInfo=ve,Ce()},function(ze,Fe){qe(Fe)})},qe)});return ve.serializer=nn,xe},_support:typeof openDatabase=="function",iterate:function(le,me){var ve=this,Re=new ee(function(xe,Ce){ve.ready().then(function(){var qe=ve._dbInfo;qe.db.transaction(function(He){Gt(He,qe,"SELECT * FROM "+qe.storeName,[],function(ze,Fe){for(var Ve=Fe.rows,Ge=Ve.length,tt=0;tt<Ge;tt++){var ut=Ve.item(tt),vt=ut.value;if(vt&&(vt=qe.serializer.deserialize(vt)),(vt=le(vt,ut.key,tt+1))!==void 0)return void xe(vt)}xe()},function(ze,Fe){Ce(Fe)})})}).catch(Ce)});return re(Re,me),Re},getItem:function(le,me){var ve=this;le=oe(le);var Re=new ee(function(xe,Ce){ve.ready().then(function(){var qe=ve._dbInfo;qe.db.transaction(function(He){Gt(He,qe,"SELECT * FROM "+qe.storeName+" WHERE key = ? LIMIT 1",[le],function(ze,Fe){var Ve=Fe.rows.length?Fe.rows.item(0).value:null;Ve&&(Ve=qe.serializer.deserialize(Ve)),xe(Ve)},function(ze,Fe){Ce(Fe)})})}).catch(Ce)});return re(Re,me),Re},setItem:function(le,me,ve){return _n.apply(this,[le,me,ve,1])},removeItem:function(le,me){var ve=this;le=oe(le);var Re=new ee(function(xe,Ce){ve.ready().then(function(){var qe=ve._dbInfo;qe.db.transaction(function(He){Gt(He,qe,"DELETE FROM "+qe.storeName+" WHERE key = ?",[le],function(){xe()},function(ze,Fe){Ce(Fe)})})}).catch(Ce)});return re(Re,me),Re},clear:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){var Ce=me._dbInfo;Ce.db.transaction(function(qe){Gt(qe,Ce,"DELETE FROM "+Ce.storeName,[],function(){Re()},function(He,ze){xe(ze)})})}).catch(xe)});return re(ve,le),ve},length:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){var Ce=me._dbInfo;Ce.db.transaction(function(qe){Gt(qe,Ce,"SELECT COUNT(key) as c FROM "+Ce.storeName,[],function(He,ze){var Fe=ze.rows.item(0).c;Re(Fe)},function(He,ze){xe(ze)})})}).catch(xe)});return re(ve,le),ve},key:function(le,me){var ve=this,Re=new ee(function(xe,Ce){ve.ready().then(function(){var qe=ve._dbInfo;qe.db.transaction(function(He){Gt(He,qe,"SELECT key FROM "+qe.storeName+" WHERE id = ? LIMIT 1",[le+1],function(ze,Fe){var Ve=Fe.rows.length?Fe.rows.item(0).key:null;xe(Ve)},function(ze,Fe){Ce(Fe)})})}).catch(Ce)});return re(Re,me),Re},keys:function(le){var me=this,ve=new ee(function(Re,xe){me.ready().then(function(){var Ce=me._dbInfo;Ce.db.transaction(function(qe){Gt(qe,Ce,"SELECT key FROM "+Ce.storeName,[],function(He,ze){for(var Fe=[],Ve=0;Ve<ze.rows.length;Ve++)Fe.push(ze.rows.item(Ve).key);Re(Fe)},function(He,ze){xe(ze)})})}).catch(xe)});return re(ve,le),ve},dropInstance:function(le,me){me=se.apply(this,arguments);var ve=this.config();(le=typeof le!="function"&&le||{}).name||(le.name=le.name||ve.name,le.storeName=le.storeName||ve.storeName);var Re,xe=this;return re(Re=le.name?new ee(function(Ce){var qe;qe=le.name===ve.name?xe._dbInfo.db:openDatabase(le.name,"","",0),le.storeName?Ce({db:qe,storeNames:[le.storeName]}):Ce(rn(qe))}).then(function(Ce){return new ee(function(qe,He){Ce.db.transaction(function(ze){function Fe(ut){return new ee(function(vt,Mt){ze.executeSql("DROP TABLE IF EXISTS "+ut,[],function(){vt()},function(on,gn){Mt(gn)})})}for(var Ve=[],Ge=0,tt=Ce.storeNames.length;Ge<tt;Ge++)Ve.push(Fe(Ce.storeNames[Ge]));ee.all(Ve).then(function(){qe()}).catch(function(ut){He(ut)})},function(ze){He(ze)})})}):ee.reject("Invalid arguments"),me),Re}};function ae(le,me){var ve=le.name+"/";return le.storeName!==me.storeName&&(ve+=le.storeName+"/"),ve}var Q={_driver:"localStorageWrapper",_initStorage:function(le){var me={};if(le)for(var ve in le)me[ve]=le[ve];return me.keyPrefix=ae(le,this._defaultConfig),!function(){var Re="_localforage_support_test";try{return localStorage.setItem(Re,!0),localStorage.removeItem(Re),!1}catch{return!0}}()||localStorage.length>0?(this._dbInfo=me,me.serializer=nn,ee.resolve()):ee.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(le,me){var ve=this,Re=ve.ready().then(function(){for(var xe=ve._dbInfo,Ce=xe.keyPrefix,qe=Ce.length,He=localStorage.length,ze=1,Fe=0;Fe<He;Fe++){var Ve=localStorage.key(Fe);if(Ve.indexOf(Ce)===0){var Ge=localStorage.getItem(Ve);if(Ge&&(Ge=xe.serializer.deserialize(Ge)),(Ge=le(Ge,Ve.substring(qe),ze++))!==void 0)return Ge}}});return re(Re,me),Re},getItem:function(le,me){var ve=this;le=oe(le);var Re=ve.ready().then(function(){var xe=ve._dbInfo,Ce=localStorage.getItem(xe.keyPrefix+le);return Ce&&(Ce=xe.serializer.deserialize(Ce)),Ce});return re(Re,me),Re},setItem:function(le,me,ve){var Re=this;le=oe(le);var xe=Re.ready().then(function(){me===void 0&&(me=null);var Ce=me;return new ee(function(qe,He){var ze=Re._dbInfo;ze.serializer.serialize(me,function(Fe,Ve){if(Ve)He(Ve);else try{localStorage.setItem(ze.keyPrefix+le,Fe),qe(Ce)}catch(Ge){Ge.name!=="QuotaExceededError"&&Ge.name!=="NS_ERROR_DOM_QUOTA_REACHED"||He(Ge),He(Ge)}})})});return re(xe,ve),xe},removeItem:function(le,me){var ve=this;le=oe(le);var Re=ve.ready().then(function(){var xe=ve._dbInfo;localStorage.removeItem(xe.keyPrefix+le)});return re(Re,me),Re},clear:function(le){var me=this,ve=me.ready().then(function(){for(var Re=me._dbInfo.keyPrefix,xe=localStorage.length-1;xe>=0;xe--){var Ce=localStorage.key(xe);Ce.indexOf(Re)===0&&localStorage.removeItem(Ce)}});return re(ve,le),ve},length:function(le){var me=this.keys().then(function(ve){return ve.length});return re(me,le),me},key:function(le,me){var ve=this,Re=ve.ready().then(function(){var xe,Ce=ve._dbInfo;try{xe=localStorage.key(le)}catch{xe=null}return xe&&(xe=xe.substring(Ce.keyPrefix.length)),xe});return re(Re,me),Re},keys:function(le){var me=this,ve=me.ready().then(function(){for(var Re=me._dbInfo,xe=localStorage.length,Ce=[],qe=0;qe<xe;qe++){var He=localStorage.key(qe);He.indexOf(Re.keyPrefix)===0&&Ce.push(He.substring(Re.keyPrefix.length))}return Ce});return re(ve,le),ve},dropInstance:function(le,me){if(me=se.apply(this,arguments),!(le=typeof le!="function"&&le||{}).name){var ve=this.config();le.name=le.name||ve.name,le.storeName=le.storeName||ve.storeName}var Re,xe=this;return Re=le.name?new ee(function(Ce){le.storeName?Ce(ae(le,xe._defaultConfig)):Ce(le.name+"/")}).then(function(Ce){for(var qe=localStorage.length-1;qe>=0;qe--){var He=localStorage.key(qe);He.indexOf(Ce)===0&&localStorage.removeItem(He)}}):ee.reject("Invalid arguments"),re(Re,me),Re}},X=function(le,me){for(var ve=le.length,Re=0;Re<ve;){if((xe=le[Re])===(Ce=me)||typeof xe=="number"&&typeof Ce=="number"&&isNaN(xe)&&isNaN(Ce))return!0;Re++}var xe,Ce;return!1},he=Array.isArray||function(le){return Object.prototype.toString.call(le)==="[object Array]"},Te={},$e={},Ue={INDEXEDDB:_t,WEBSQL:Qt,LOCALSTORAGE:Q},ct=[Ue.INDEXEDDB._driver,Ue.WEBSQL._driver,Ue.LOCALSTORAGE._driver],kt=["dropInstance"],yt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(kt),It={description:"",driver:ct.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function St(le,me){le[me]=function(){var ve=arguments;return le.ready().then(function(){return le[me].apply(le,ve)})}}function dn(){for(var le=1;le<arguments.length;le++){var me=arguments[le];if(me)for(var ve in me)me.hasOwnProperty(ve)&&(he(me[ve])?arguments[0][ve]=me[ve].slice():arguments[0][ve]=me[ve])}return arguments[0]}var Qn=function(){function le(me){for(var ve in function(Ce,qe){if(!(Ce instanceof qe))throw new TypeError("Cannot call a class as a function")}(this,le),Ue)if(Ue.hasOwnProperty(ve)){var Re=Ue[ve],xe=Re._driver;this[ve]=xe,Te[xe]||this.defineDriver(Re)}this._defaultConfig=dn({},It),this._config=dn({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return le.prototype.config=function(me){if((me===void 0?"undefined":K(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ve in me){if(ve==="storeName"&&(me[ve]=me[ve].replace(/\W/g,"_")),ve==="version"&&typeof me[ve]!="number")return new Error("Database version must be a number.");this._config[ve]=me[ve]}return!("driver"in me)||!me.driver||this.setDriver(this._config.driver)}return typeof me=="string"?this._config[me]:this._config},le.prototype.defineDriver=function(me,ve,Re){var xe=new ee(function(Ce,qe){try{var He=me._driver,ze=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver)return void qe(ze);for(var Fe=yt.concat("_initStorage"),Ve=0,Ge=Fe.length;Ve<Ge;Ve++){var tt=Fe[Ve];if((!X(kt,tt)||me[tt])&&typeof me[tt]!="function")return void qe(ze)}(function(){for(var vt=function($n){return function(){var Yn=new Error("Method "+$n+" is not implemented by the current driver"),Nt=ee.reject(Yn);return re(Nt,arguments[arguments.length-1]),Nt}},Mt=0,on=kt.length;Mt<on;Mt++){var gn=kt[Mt];me[gn]||(me[gn]=vt(gn))}})();var ut=function(vt){Te[He]&&console.info("Redefining LocalForage driver: "+He),Te[He]=me,$e[He]=vt,Ce()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(ut,qe):ut(!!me._support):ut(!0)}catch(vt){qe(vt)}});return ce(xe,ve,Re),xe},le.prototype.driver=function(){return this._driver||null},le.prototype.getDriver=function(me,ve,Re){var xe=Te[me]?ee.resolve(Te[me]):ee.reject(new Error("Driver not found."));return ce(xe,ve,Re),xe},le.prototype.getSerializer=function(me){var ve=ee.resolve(nn);return ce(ve,me),ve},le.prototype.ready=function(me){var ve=this,Re=ve._driverSet.then(function(){return ve._ready===null&&(ve._ready=ve._initDriver()),ve._ready});return ce(Re,me,me),Re},le.prototype.setDriver=function(me,ve,Re){var xe=this;he(me)||(me=[me]);var Ce=this._getSupportedDrivers(me);function qe(){xe._config.driver=xe.driver()}function He(Fe){return xe._extend(Fe),qe(),xe._ready=xe._initStorage(xe._config),xe._ready}var ze=this._driverSet!==null?this._driverSet.catch(function(){return ee.resolve()}):ee.resolve();return this._driverSet=ze.then(function(){var Fe=Ce[0];return xe._dbInfo=null,xe._ready=null,xe.getDriver(Fe).then(function(Ve){xe._driver=Ve._driver,qe(),xe._wrapLibraryMethodsWithReady(),xe._initDriver=function(Ge){return function(){var tt=0;return function ut(){for(;tt<Ge.length;){var vt=Ge[tt];return tt++,xe._dbInfo=null,xe._ready=null,xe.getDriver(vt).then(He).catch(ut)}qe();var Mt=new Error("No available storage method found.");return xe._driverSet=ee.reject(Mt),xe._driverSet}()}}(Ce)})}).catch(function(){qe();var Fe=new Error("No available storage method found.");return xe._driverSet=ee.reject(Fe),xe._driverSet}),ce(this._driverSet,ve,Re),this._driverSet},le.prototype.supports=function(me){return!!$e[me]},le.prototype._extend=function(me){dn(this,me)},le.prototype._getSupportedDrivers=function(me){for(var ve=[],Re=0,xe=me.length;Re<xe;Re++){var Ce=me[Re];this.supports(Ce)&&ve.push(Ce)}return ve},le.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,ve=yt.length;me<ve;me++)St(this,yt[me])},le.prototype.createInstance=function(me){return new le(me)},le}(),Gn=new Qn;F.exports=Gn},{3:3}]},{},[4])(4)},961:(I,D,a)=>{var O,F=function(){var z=String.fromCharCode,K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",ne={};function ee(ce,oe){if(!ne[ce]){ne[ce]={};for(var se=0;se<ce.length;se++)ne[ce][ce.charAt(se)]=se}return ne[ce][oe]}var re={compressToBase64:function(ce){if(ce==null)return"";var oe=re._compress(ce,6,function(se){return K.charAt(se)});switch(oe.length%4){default:case 0:return oe;case 1:return oe+"===";case 2:return oe+"==";case 3:return oe+"="}},decompressFromBase64:function(ce){return ce==null?"":ce==""?null:re._decompress(ce.length,32,function(oe){return ee(K,ce.charAt(oe))})},compressToUTF16:function(ce){return ce==null?"":re._compress(ce,15,function(oe){return z(oe+32)})+" "},decompressFromUTF16:function(ce){return ce==null?"":ce==""?null:re._decompress(ce.length,16384,function(oe){return ce.charCodeAt(oe)-32})},compressToUint8Array:function(ce){for(var oe=re.compress(ce),se=new Uint8Array(2*oe.length),fe=0,ge=oe.length;fe<ge;fe++){var ue=oe.charCodeAt(fe);se[2*fe]=ue>>>8,se[2*fe+1]=ue%256}return se},decompressFromUint8Array:function(ce){if(ce==null)return re.decompress(ce);for(var oe=new Array(ce.length/2),se=0,fe=oe.length;se<fe;se++)oe[se]=256*ce[2*se]+ce[2*se+1];var ge=[];return oe.forEach(function(ue){ge.push(z(ue))}),re.decompress(ge.join(""))},compressToEncodedURIComponent:function(ce){return ce==null?"":re._compress(ce,6,function(oe){return te.charAt(oe)})},decompressFromEncodedURIComponent:function(ce){return ce==null?"":ce==""?null:(ce=ce.replace(/ /g,"+"),re._decompress(ce.length,32,function(oe){return ee(te,ce.charAt(oe))}))},compress:function(ce){return re._compress(ce,16,function(oe){return z(oe)})},_compress:function(ce,oe,se){if(ce==null)return"";var fe,ge,ue,_e={},pe={},ye="",we="",Ie="",be=2,Se=3,Me=2,We=[],Je=0,Le=0;for(ue=0;ue<ce.length;ue+=1)if(ye=ce.charAt(ue),Object.prototype.hasOwnProperty.call(_e,ye)||(_e[ye]=Se++,pe[ye]=!0),we=Ie+ye,Object.prototype.hasOwnProperty.call(_e,we))Ie=we;else{if(Object.prototype.hasOwnProperty.call(pe,Ie)){if(Ie.charCodeAt(0)<256){for(fe=0;fe<Me;fe++)Je<<=1,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++;for(ge=Ie.charCodeAt(0),fe=0;fe<8;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1}else{for(ge=1,fe=0;fe<Me;fe++)Je=Je<<1|ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge=0;for(ge=Ie.charCodeAt(0),fe=0;fe<16;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1}--be==0&&(be=Math.pow(2,Me),Me++),delete pe[Ie]}else for(ge=_e[Ie],fe=0;fe<Me;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1;--be==0&&(be=Math.pow(2,Me),Me++),_e[we]=Se++,Ie=String(ye)}if(Ie!==""){if(Object.prototype.hasOwnProperty.call(pe,Ie)){if(Ie.charCodeAt(0)<256){for(fe=0;fe<Me;fe++)Je<<=1,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++;for(ge=Ie.charCodeAt(0),fe=0;fe<8;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1}else{for(ge=1,fe=0;fe<Me;fe++)Je=Je<<1|ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge=0;for(ge=Ie.charCodeAt(0),fe=0;fe<16;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1}--be==0&&(be=Math.pow(2,Me),Me++),delete pe[Ie]}else for(ge=_e[Ie],fe=0;fe<Me;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1;--be==0&&(be=Math.pow(2,Me),Me++)}for(ge=2,fe=0;fe<Me;fe++)Je=Je<<1|1&ge,Le==oe-1?(Le=0,We.push(se(Je)),Je=0):Le++,ge>>=1;for(;;){if(Je<<=1,Le==oe-1){We.push(se(Je));break}Le++}return We.join("")},decompress:function(ce){return ce==null?"":ce==""?null:re._decompress(ce.length,32768,function(oe){return ce.charCodeAt(oe)})},_decompress:function(ce,oe,se){var fe,ge,ue,_e,pe,ye,we,Ie=[],be=4,Se=4,Me=3,We="",Je=[],Le={val:se(0),position:oe,index:1};for(fe=0;fe<3;fe+=1)Ie[fe]=fe;for(ue=0,pe=Math.pow(2,2),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;switch(ue){case 0:for(ue=0,pe=Math.pow(2,8),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;we=z(ue);break;case 1:for(ue=0,pe=Math.pow(2,16),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;we=z(ue);break;case 2:return""}for(Ie[3]=we,ge=we,Je.push(we);;){if(Le.index>ce)return"";for(ue=0,pe=Math.pow(2,Me),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;switch(we=ue){case 0:for(ue=0,pe=Math.pow(2,8),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;Ie[Se++]=z(ue),we=Se-1,be--;break;case 1:for(ue=0,pe=Math.pow(2,16),ye=1;ye!=pe;)_e=Le.val&Le.position,Le.position>>=1,Le.position==0&&(Le.position=oe,Le.val=se(Le.index++)),ue|=(_e>0?1:0)*ye,ye<<=1;Ie[Se++]=z(ue),we=Se-1,be--;break;case 2:return Je.join("")}if(be==0&&(be=Math.pow(2,Me),Me++),Ie[we])We=Ie[we];else{if(we!==Se)return null;We=ge+ge.charAt(0)}Je.push(We),Ie[Se++]=ge+We.charAt(0),ge=We,--be==0&&(be=Math.pow(2,Me),Me++)}}};return re}();(O=(function(){return F}).call(D,a,D,I))===void 0||(I.exports=O)},895:I=>{I.exports=function(D,a,O,F){var z=D[0],K=D[1],te=!1;O===void 0&&(O=0),F===void 0&&(F=a.length);for(var ne=(F-O)/2,ee=0,re=ne-1;ee<ne;re=ee++){var ce=a[O+2*ee+0],oe=a[O+2*ee+1],se=a[O+2*re+0],fe=a[O+2*re+1];oe>K!=fe>K&&z<(se-ce)*(K-oe)/(fe-oe)+ce&&(te=!te)}return te}},946:(I,D,a)=>{const O=a(909),F=async()=>await O.get({dir:"areaList",file:"index"}),z=({name:re,list:ce})=>{let oe=re;const se=ce.find(ge=>oe.indexOf(ge.name)!==-1);if(se){const ge=se.name.length;return oe=oe.slice(ge,re.length),{id:se.id,name:oe,children:se.children}}const fe=ce.find(ge=>oe.indexOf(ge.shortName)!==-1);if(fe){const ge=fe.shortName.length;return oe=oe.slice(ge,re.length),{id:fe.id,name:oe,children:fe.children}}return null},K=async(re="",ce)=>{let oe=re;const se={province:"",city:"",district:""};let fe=ce;ce||(fe=await F());const ge=z({name:oe,list:fe});if(ge){oe=ge.name,se.province=ge.id;const pe=ge.children,ye=z({name:oe,list:pe});if(ye){oe=ye.name,se.city=ye.id;const be=z({name:oe,list:ye.children});return be&&(oe=be.name,se.district=be.id),se}const we=pe.reduce((be,Se)=>Se.children?be.concat(Se.children):be,[]),Ie=z({name:oe,list:we});return Ie&&(oe=Ie.name,se.district=Ie.id),se}const ue=fe.reduce((pe,ye)=>ye.children?pe.concat(ye.children):pe,[]),_e=z({name:oe,list:ue});if(_e){oe=_e.name,se.city=_e.id;const pe=z({name:oe,list:_e.children});pe&&(oe=pe.name,se.district=pe.id)}return se},te=async(re={})=>{let{code:ce}={...re};ce=typeof ce=="string"?ce:ce.toString();const oe={province:"",provinceCode:"",city:"",cityCode:"",district:"",districtCode:"",code:ce,address:""};if((await F()).every(se=>se.id===ce?(oe.province=se.name,oe.provinceCode=se.id,!1):!se.children||se.children.every(fe=>fe.id===ce?(oe.province=se.name,oe.provinceCode=se.id,oe.city=fe.name,oe.cityCode=fe.id,!1):!fe.children||fe.children.every(ge=>ge.id!==ce||(oe.province=se.name,oe.provinceCode=se.id,oe.city=fe.name,oe.cityCode=fe.id,oe.district=ge.name,oe.districtCode=ge.id,!1)))))throw new Error("未找到该地区");return oe.address=oe.province+oe.city+oe.district,oe},ne=async({provinceCode:re,cityCode:ce,districtCode:oe})=>{const se={province:{},city:{},district:{}};if(re){const fe=await O.get({dir:"province",file:re});se.province={code:fe.id,location:fe.location,name:fe.name,pinyin:fe.pinyin}}if(ce){const fe=(await O.get({dir:"city",file:re})).find(ge=>ge.id===ce);se.city={code:fe.id,location:fe.location,name:fe.name,pinyin:fe.pinyin}}if(oe){const fe=(await O.get({dir:"district",file:ce})).find(ge=>ge.id===oe);se.district={code:fe.id,location:fe.location,name:fe.name,pinyin:fe.pinyin}}return se},ee=async(re,ce)=>{let oe=ce;if(oe||(oe=await F()),!re)return oe.map(se=>({code:se.id,name:se.name}));for(let se=0;se<oe.length;se++){const fe=oe[se];if(fe.id===re&&fe.children)return fe.children.map(ge=>({code:ge.id,name:ge.name}));if(fe.children){const ge=await ee(re,fe.children);if(ge)return ge}}};I.exports={getList:ee,searchCodeInfo:async({code:re,detail:ce})=>{const{province:oe,city:se,district:fe,address:ge,provinceCode:ue,cityCode:_e,districtCode:pe}=await te({code:re}),ye={province:oe,city:se,district:fe,address:ge,code:re};if(ce){const we=await ne({provinceCode:ue,cityCode:_e,districtCode:pe});ye.detail=we}return ye},searchStrAddress:async re=>{const{province:ce,city:oe,district:se}=await K(re);return se||oe||ce||null},analysisAddress:K,searchCodeDetailInfo:async({code:re})=>{const{provinceCode:ce,cityCode:oe,districtCode:se}=await te({code:re}),fe=await ne({provinceCode:ce,cityCode:oe,districtCode:se});return Object.keys(fe.district).length?fe.district:Object.keys(fe.city).length?fe.city:Object.keys(fe.province).length?fe.province:void 0}}},182:I=>{I.exports=new class{constructor(){this.config={timeout:1e4,enableHighAccuracy:!1,detail:!1},this.cdn=["https://npm.onmicrosoft.cn/@pikaz/location/lib","https://unpkg.com/@pikaz/location/lib"],this.userCdn=""}set(D){this.config={...this.config,...D},this.config.url&&(this.userCdn=this.config.url)}}},955:(I,D,a)=>{const O=a(909),F=a(895),z=a(182),K=({latitude:te,longitude:ne,address:ee})=>ee.find(re=>re.polygon.find(ce=>{if(F([ne,te],ce))return ce}));I.exports={getGeo:(te={})=>{const{enableHighAccuracy:ne,timeout:ee}={...z.config,...te};return new Promise((re,ce)=>{if(navigator.geolocation){const oe=navigator.geolocation.watchPosition(se=>{const{latitude:fe,longitude:ge}=se.coords;navigator.geolocation.clearWatch(oe),re({latitude:fe,longitude:ge})},se=>{switch(navigator.geolocation.clearWatch(oe),se.code){case se.PERMISSION_DENIED:ce(new Error("html5已拒绝定位"));break;case se.POSITION_UNAVAILABLE:ce(new Error("html5位置信息不可用"));break;case se.TIMEOUT:ce(new Error("定位超时"));break;case se.UNKNOWN_ERROR:ce(new Error("html5定位未知错误"))}},{enableHighAccuracy:ne,timeout:ee,maximumAge:0})}else ce(new Error("浏览器不支持HTML5定位"))})},getGeoCode:async({latitude:te,longitude:ne})=>{try{let ee="";const re=(await O.get({dir:"province",file:"short"})).filter(oe=>K({latitude:te,longitude:ne,address:[oe]}));let ce="";for(let oe=0;oe<re.length;oe++){const{id:se}=re[oe],fe=await O.get({dir:"province",file:se}),ge=K({latitude:te,longitude:ne,address:[fe]});ge&&(ce=ge)}if(ce){ee=ce.id;const oe=await O.get({dir:"city",file:ce.id}),se=K({latitude:te,longitude:ne,address:oe});if(se){ee=se.id;const fe=await O.get({dir:"district",file:se.id}),ge=K({latitude:te,longitude:ne,address:fe});ge&&(ee=ge.id)}}if(!ee)throw new Error("非中国境内");return ee}catch(ee){throw ee}}}},909:(I,D,a)=>{const O=a(218),{decompressFromEncodedURIComponent:F}=a(961),z=a(483),K=a(182),{version:te,fileDate:ne}=a(147);I.exports=new class{constructor(){this.local=null,this.localConfig={name:"pikazLocation",storeName:"v"+te.split(".")[0]+"."+te.split(".")[1]}}async get({dir:ee,file:re}){if(!this.local){const se=z.createInstance(this.localConfig);await se.ready(),this.local=se}const ce=`${ee}-${re}-${ne[ee]}`,oe=await this.local.getItem(ce);if(oe)return oe;try{const se=await(async({file:fe})=>{const ge=O.CancelToken;let ue;const _e=async(pe,ye)=>{const we=await O({url:`${pe}/static/${ye}.json`,method:"get",dataType:"json",cancelToken:new ge(function(be){ue=be}),timeout:K.timeout});if(!we||!we.data||Object.prototype.toString.call(we.data.s)!="[object String]")throw new Error("未获取到文件");const Ie=F(we.data.s);return JSON.parse(Ie)};try{const pe=K.userCdn;if(pe)return await _e(pe,fe);throw new Error("未找到设置的url")}catch{const ye=K.cdn.map(we=>new Promise(Ie=>{_e(we,fe).then(be=>{Ie(be)}).catch(()=>{})}));try{return await Promise.race(ye)}catch{throw new Error("定位失败")}finally{ue()}}})({file:`${ee}/${re}`});return this.local.setItem(ce,se),se}catch{throw new Error("定位失败")}}async getVal({key:ee,gainVal:re,expiration:ce}){if(!this.local){const _e=z.createInstance(this.localConfig);await _e.ready(),this.local=_e}const oe=new Date().getTime(),se=ce||0,fe=`local-${ee}`,ge=await this.local.getItem(fe);if(ge&&ge.expiration>oe)return ge.val;const ue=await re();return await this.local.setItem(fe,{val:ue,expiration:oe+se}),ue}async clear(){await this.local.clear()}}},138:(I,D,a)=>{const O=a(182),{getGeo:F,getGeoCode:z}=a(955),{getList:K,searchCodeInfo:te,searchStrAddress:ne,searchCodeDetailInfo:ee}=a(946),{getIpCode:re}=a(454),ce=async(ue,_e={})=>{let{timeout:pe}={...O.config,..._e};return await Promise.race([ue(_e),new Promise((ye,we)=>{setTimeout(()=>{we(new Error("定位超时"))},pe)})])},oe=async(ue={})=>{let{timeout:_e,enableHighAccuracy:pe,detail:ye,latitude:we,longitude:Ie}={...O.config,...ue};if(!we||!Ie){const{latitude:be,longitude:Se}=await F({timeout:_e,enableHighAccuracy:pe});we=be,Ie=Se}return await ce(async()=>{const be=await z({latitude:we,longitude:Ie});if(!be)throw new Error("非中国境内");return{...await te({code:be,detail:ye}),latitude:we,longitude:Ie}},{timeout:_e})},se=async(ue={})=>{let{detail:_e,ip:pe}={...O.config,...ue};const{code:ye,ip:we}=await re({ip:pe});return pe||(pe=we),{...await te({code:ye,detail:_e}),ip:pe}},fe=async(ue={})=>{const{address:_e,detail:pe}={...O.config,...ue},ye=await ne(_e);if(!ye)throw new Error("解析地址失败,请确认地址包含省级或市级名称");return await te({code:ye,detail:pe})},ge=async(ue={})=>{const{code:_e,detail:pe}={...O.config,...ue};return await te({code:_e,detail:pe})};I.exports={setConfig:({timeout:ue,url:_e})=>{O.set({timeout:ue,url:_e})},getLocation:async(ue={})=>{try{return{...await oe(ue),type:"h5"}}catch{return{...await ce(se,ue),type:"ip"}}},getH5Location:oe,getIpLocation:ue=>ce(se,ue),searchList:async(ue={})=>{const{code:_e}={...ue};return await K(_e||"")||[]},searchCodeAddress:ue=>ce(ge,ue),searchAddress:ue=>ce(fe,ue),searchCodeDetail:ue=>ce(ee,ue)}},454:(I,D,a)=>{const{decompressFromEncodedURIComponent:O}=a(961),F=a(909),z=te=>{const ne=te.split(".").reduce((ee,re)=>`${ee}${(ce=>{const oe=ce.split("").reverse();return new Array(3).fill(0).map((se,fe)=>oe[fe]||0).reverse().join("")})(re)}`,"");return Number(ne)},K=()=>new Promise((te,ne)=>{const ee="ipCallback"+new Date().getTime(),re=document.createElement("script");re.onerror=()=>{ne(new Error("获取ip失败"))},window[ee]=ce=>{ce&&ce.ip?te(ce.ip):ne(new Error("ip定位失败"))},re.src=O("BYFxAcGcC4HpYIbgJYDpkoGYE9UHsAnAc1gH5NCBbBEAXgCtI8A7cAMjYGMEAbHgIwScA1rSA")+ee,document.body.appendChild(re)});I.exports={addZero:z,getIpCode:async(te={})=>{let{ip:ne}={...te};ne||(ne=await F.getVal({key:"ip",gainVal:K,expiration:864e5}));const ee=ne.split(".").map(re=>Number(re)||0);if(ee.length!==4)throw new Error("ip格式错误,只支持ipv4");return{code:(await F.get({dir:"ip",file:`${ee[0]}.${ee[1]}`})).reduce((re,ce)=>{const{district:oe,id:se}=ce,fe=z(ne);return fe>=oe[0]&&fe<=oe[1]?se:re},""),ip:ne}}}},218:(I,D,a)=>{function O(ie,de){return function(){return ie.apply(de,arguments)}}const{toString:F}=Object.prototype,{getPrototypeOf:z}=Object,K=(te=Object.create(null),ie=>{const de=F.call(ie);return te[de]||(te[de]=de.slice(8,-1).toLowerCase())});var te;const ne=ie=>(ie=ie.toLowerCase(),de=>K(de)===ie),ee=ie=>de=>typeof de===ie,{isArray:re}=Array,ce=ee("undefined"),oe=ne("ArrayBuffer"),se=ee("string"),fe=ee("function"),ge=ee("number"),ue=ie=>ie!==null&&typeof ie=="object",_e=ie=>{if(K(ie)!=="object")return!1;const de=z(ie);return!(de!==null&&de!==Object.prototype&&Object.getPrototypeOf(de)!==null||Symbol.toStringTag in ie||Symbol.iterator in ie)},pe=ne("Date"),ye=ne("File"),we=ne("Blob"),Ie=ne("FileList"),be=ne("URLSearchParams");function Se(ie,de,{allOwnKeys:ke=!1}={}){if(ie==null)return;let Oe,Ae;if(typeof ie!="object"&&(ie=[ie]),re(ie))for(Oe=0,Ae=ie.length;Oe<Ae;Oe++)de.call(null,ie[Oe],Oe,ie);else{const Ne=ke?Object.getOwnPropertyNames(ie):Object.keys(ie),Be=Ne.length;let Ke;for(Oe=0;Oe<Be;Oe++)Ke=Ne[Oe],de.call(null,ie[Ke],Ke,ie)}}function Me(ie,de){de=de.toLowerCase();const ke=Object.keys(ie);let Oe,Ae=ke.length;for(;Ae-- >0;)if(Oe=ke[Ae],de===Oe.toLowerCase())return Oe;return null}const We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:a.g,Je=ie=>!ce(ie)&&ie!==We,Le=(Tt=typeof Uint8Array<"u"&&z(Uint8Array),ie=>Tt&&ie instanceof Tt);var Tt;const Et=ne("HTMLFormElement"),At=(({hasOwnProperty:ie})=>(de,ke)=>ie.call(de,ke))(Object.prototype),jt=ne("RegExp"),Pt=(ie,de)=>{const ke=Object.getOwnPropertyDescriptors(ie),Oe={};Se(ke,(Ae,Ne)=>{let Be;(Be=de(Ae,Ne,ie))!==!1&&(Oe[Ne]=Be||Ae)}),Object.defineProperties(ie,Oe)},_t="abcdefghijklmnopqrstuvwxyz",rt="0123456789",Vt={DIGIT:rt,ALPHA:_t,ALPHA_DIGIT:_t+_t.toUpperCase()+rt},Rt=ne("AsyncFunction");var Pe={isArray:re,isArrayBuffer:oe,isBuffer:function(ie){return ie!==null&&!ce(ie)&&ie.constructor!==null&&!ce(ie.constructor)&&fe(ie.constructor.isBuffer)&&ie.constructor.isBuffer(ie)},isFormData:ie=>{let de;return ie&&(typeof FormData=="function"&&ie instanceof FormData||fe(ie.append)&&((de=K(ie))==="formdata"||de==="object"&&fe(ie.toString)&&ie.toString()==="[object FormData]"))},isArrayBufferView:function(ie){let de;return de=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ie):ie&&ie.buffer&&oe(ie.buffer),de},isString:se,isNumber:ge,isBoolean:ie=>ie===!0||ie===!1,isObject:ue,isPlainObject:_e,isUndefined:ce,isDate:pe,isFile:ye,isBlob:we,isRegExp:jt,isFunction:fe,isStream:ie=>ue(ie)&&fe(ie.pipe),isURLSearchParams:be,isTypedArray:Le,isFileList:Ie,forEach:Se,merge:function ie(){const{caseless:de}=Je(this)&&this||{},ke={},Oe=(Ae,Ne)=>{const Be=de&&Me(ke,Ne)||Ne;_e(ke[Be])&&_e(Ae)?ke[Be]=ie(ke[Be],Ae):_e(Ae)?ke[Be]=ie({},Ae):re(Ae)?ke[Be]=Ae.slice():ke[Be]=Ae};for(let Ae=0,Ne=arguments.length;Ae<Ne;Ae++)arguments[Ae]&&Se(arguments[Ae],Oe);return ke},extend:(ie,de,ke,{allOwnKeys:Oe}={})=>(Se(de,(Ae,Ne)=>{ke&&fe(Ae)?ie[Ne]=O(Ae,ke):ie[Ne]=Ae},{allOwnKeys:Oe}),ie),trim:ie=>ie.trim?ie.trim():ie.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ie=>(ie.charCodeAt(0)===65279&&(ie=ie.slice(1)),ie),inherits:(ie,de,ke,Oe)=>{ie.prototype=Object.create(de.prototype,Oe),ie.prototype.constructor=ie,Object.defineProperty(ie,"super",{value:de.prototype}),ke&&Object.assign(ie.prototype,ke)},toFlatObject:(ie,de,ke,Oe)=>{let Ae,Ne,Be;const Ke={};if(de=de||{},ie==null)return de;do{for(Ae=Object.getOwnPropertyNames(ie),Ne=Ae.length;Ne-- >0;)Be=Ae[Ne],Oe&&!Oe(Be,ie,de)||Ke[Be]||(de[Be]=ie[Be],Ke[Be]=!0);ie=ke!==!1&&z(ie)}while(ie&&(!ke||ke(ie,de))&&ie!==Object.prototype);return de},kindOf:K,kindOfTest:ne,endsWith:(ie,de,ke)=>{ie=String(ie),(ke===void 0||ke>ie.length)&&(ke=ie.length),ke-=de.length;const Oe=ie.indexOf(de,ke);return Oe!==-1&&Oe===ke},toArray:ie=>{if(!ie)return null;if(re(ie))return ie;let de=ie.length;if(!ge(de))return null;const ke=new Array(de);for(;de-- >0;)ke[de]=ie[de];return ke},forEachEntry:(ie,de)=>{const ke=(ie&&ie[Symbol.iterator]).call(ie);let Oe;for(;(Oe=ke.next())&&!Oe.done;){const Ae=Oe.value;de.call(ie,Ae[0],Ae[1])}},matchAll:(ie,de)=>{let ke;const Oe=[];for(;(ke=ie.exec(de))!==null;)Oe.push(ke);return Oe},isHTMLForm:Et,hasOwnProperty:At,hasOwnProp:At,reduceDescriptors:Pt,freezeMethods:ie=>{Pt(ie,(de,ke)=>{if(fe(ie)&&["arguments","caller","callee"].indexOf(ke)!==-1)return!1;const Oe=ie[ke];fe(Oe)&&(de.enumerable=!1,"writable"in de?de.writable=!1:de.set||(de.set=()=>{throw Error("Can not rewrite read-only method '"+ke+"'")}))})},toObjectSet:(ie,de)=>{const ke={},Oe=Ae=>{Ae.forEach(Ne=>{ke[Ne]=!0})};return re(ie)?Oe(ie):Oe(String(ie).split(de)),ke},toCamelCase:ie=>ie.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(de,ke,Oe){return ke.toUpperCase()+Oe}),noop:()=>{},toFiniteNumber:(ie,de)=>(ie=+ie,Number.isFinite(ie)?ie:de),findKey:Me,global:We,isContextDefined:Je,ALPHABET:Vt,generateString:(ie=16,de=Vt.ALPHA_DIGIT)=>{let ke="";const{length:Oe}=de;for(;ie--;)ke+=de[Math.random()*Oe|0];return ke},isSpecCompliantForm:function(ie){return!!(ie&&fe(ie.append)&&ie[Symbol.toStringTag]==="FormData"&&ie[Symbol.iterator])},toJSONObject:ie=>{const de=new Array(10),ke=(Oe,Ae)=>{if(ue(Oe)){if(de.indexOf(Oe)>=0)return;if(!("toJSON"in Oe)){de[Ae]=Oe;const Ne=re(Oe)?[]:{};return Se(Oe,(Be,Ke)=>{const Qe=ke(Be,Ae+1);!ce(Qe)&&(Ne[Ke]=Qe)}),de[Ae]=void 0,Ne}}return Oe};return ke(ie,0)},isAsyncFn:Rt,isThenable:ie=>ie&&(ue(ie)||fe(ie))&&fe(ie.then)&&fe(ie.catch)};function it(ie,de,ke,Oe,Ae){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ie,this.name="AxiosError",de&&(this.code=de),ke&&(this.config=ke),Oe&&(this.request=Oe),Ae&&(this.response=Ae)}Pe.inherits(it,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Pe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zt=it.prototype,Bt={};function nt(ie){return Pe.isPlainObject(ie)||Pe.isArray(ie)}function et(ie){return Pe.endsWith(ie,"[]")?ie.slice(0,-2):ie}function ot(ie,de,ke){return ie?ie.concat(de).map(function(Oe,Ae){return Oe=et(Oe),!ke&&Ae?"["+Oe+"]":Oe}).join(ke?".":""):de}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ie=>{Bt[ie]={value:ie}}),Object.defineProperties(it,Bt),Object.defineProperty(zt,"isAxiosError",{value:!0}),it.from=(ie,de,ke,Oe,Ae,Ne)=>{const Be=Object.create(zt);return Pe.toFlatObject(ie,Be,function(Ke){return Ke!==Error.prototype},Ke=>Ke!=="isAxiosError"),it.call(Be,ie.message,de,ke,Oe,Ae),Be.cause=ie,Be.name=ie.name,Ne&&Object.assign(Be,Ne),Be};const st=Pe.toFlatObject(Pe,{},null,function(ie){return/^is[A-Z]/.test(ie)});function gt(ie,de,ke){if(!Pe.isObject(ie))throw new TypeError("target must be an object");de=de||new FormData;const Oe=(ke=Pe.toFlatObject(ke,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Xe,wt){return!Pe.isUndefined(wt[Xe])})).metaTokens,Ae=ke.visitor||Ze,Ne=ke.dots,Be=ke.indexes,Ke=(ke.Blob||typeof Blob<"u"&&Blob)&&Pe.isSpecCompliantForm(de);if(!Pe.isFunction(Ae))throw new TypeError("visitor must be a function");function Qe(Xe){if(Xe===null)return"";if(Pe.isDate(Xe))return Xe.toISOString();if(!Ke&&Pe.isBlob(Xe))throw new it("Blob is not supported. Use a Buffer instead.");return Pe.isArrayBuffer(Xe)||Pe.isTypedArray(Xe)?Ke&&typeof Blob=="function"?new Blob([Xe]):Buffer.from(Xe):Xe}function Ze(Xe,wt,Ye){let Ot=Xe;if(Xe&&!Ye&&typeof Xe=="object"){if(Pe.endsWith(wt,"{}"))wt=Oe?wt:wt.slice(0,-2),Xe=JSON.stringify(Xe);else if(Pe.isArray(Xe)&&function(Ft){return Pe.isArray(Ft)&&!Ft.some(nt)}(Xe)||(Pe.isFileList(Xe)||Pe.endsWith(wt,"[]"))&&(Ot=Pe.toArray(Xe)))return wt=et(wt),Ot.forEach(function(Ft,an){!Pe.isUndefined(Ft)&&Ft!==null&&de.append(Be===!0?ot([wt],an,Ne):Be===null?wt:wt+"[]",Qe(Ft))}),!1}return!!nt(Xe)||(de.append(ot(Ye,wt,Ne),Qe(Xe)),!1)}const je=[],ft=Object.assign(st,{defaultVisitor:Ze,convertValue:Qe,isVisitable:nt});if(!Pe.isObject(ie))throw new TypeError("data must be an object");return function Xe(wt,Ye){if(!Pe.isUndefined(wt)){if(je.indexOf(wt)!==-1)throw Error("Circular reference detected in "+Ye.join("."));je.push(wt),Pe.forEach(wt,function(Ot,Ft){(!(Pe.isUndefined(Ot)||Ot===null)&&Ae.call(de,Ot,Pe.isString(Ft)?Ft.trim():Ft,Ye,ft))===!0&&Xe(Ot,Ye?Ye.concat(Ft):[Ft])}),je.pop()}}(ie),de}function Dt(ie){const de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ie).replace(/[!'()~]|%20|%00/g,function(ke){return de[ke]})}function Ut(ie,de){this._pairs=[],ie&>(ie,this,de)}const Lt=Ut.prototype;function Zt(ie){return encodeURIComponent(ie).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Kt(ie,de,ke){if(!de)return ie;const Oe=ke&&ke.encode||Zt,Ae=ke&&ke.serialize;let Ne;if(Ne=Ae?Ae(de,ke):Pe.isURLSearchParams(de)?de.toString():new Ut(de,ke).toString(Oe),Ne){const Be=ie.indexOf("#");Be!==-1&&(ie=ie.slice(0,Be)),ie+=(ie.indexOf("?")===-1?"?":"&")+Ne}return ie}Lt.append=function(ie,de){this._pairs.push([ie,de])},Lt.toString=function(ie){const de=ie?function(ke){return ie.call(this,ke,Dt)}:Dt;return this._pairs.map(function(ke){return de(ke[0])+"="+de(ke[1])},"").join("&")};var fn=class{constructor(){this.handlers=[]}use(ie,de,ke){return this.handlers.push({fulfilled:ie,rejected:de,synchronous:!!ke&&ke.synchronous,runWhen:ke?ke.runWhen:null}),this.handlers.length-1}eject(ie){this.handlers[ie]&&(this.handlers[ie]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ie){Pe.forEach(this.handlers,function(de){de!==null&&ie(de)})}},tn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ut,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};const Wt=typeof window<"u"&&typeof document<"u",Gt=(_n=typeof navigator<"u"&&navigator.product,Wt&&["ReactNative","NativeScript","NS"].indexOf(_n)<0);var _n;const rn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Qt={...Object.freeze({__proto__:null,hasBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:rn,hasStandardBrowserEnv:Gt}),...nn};function ae(ie){function de(ke,Oe,Ae,Ne){let Be=ke[Ne++];const Ke=Number.isFinite(+Be),Qe=Ne>=ke.length;return Be=!Be&&Pe.isArray(Ae)?Ae.length:Be,Qe?(Pe.hasOwnProp(Ae,Be)?Ae[Be]=[Ae[Be],Oe]:Ae[Be]=Oe,!Ke):(Ae[Be]&&Pe.isObject(Ae[Be])||(Ae[Be]=[]),de(ke,Oe,Ae[Be],Ne)&&Pe.isArray(Ae[Be])&&(Ae[Be]=function(Ze){const je={},ft=Object.keys(Ze);let Xe;const wt=ft.length;let Ye;for(Xe=0;Xe<wt;Xe++)Ye=ft[Xe],je[Ye]=Ze[Ye];return je}(Ae[Be])),!Ke)}if(Pe.isFormData(ie)&&Pe.isFunction(ie.entries)){const ke={};return Pe.forEachEntry(ie,(Oe,Ae)=>{de(function(Ne){return Pe.matchAll(/\w+|\[(\w*)]/g,Ne).map(Be=>Be[0]==="[]"?"":Be[1]||Be[0])}(Oe),Ae,ke,0)}),ke}return null}const Q={transitional:tn,adapter:["xhr","http"],transformRequest:[function(ie,de){const ke=de.getContentType()||"",Oe=ke.indexOf("application/json")>-1,Ae=Pe.isObject(ie);if(Ae&&Pe.isHTMLForm(ie)&&(ie=new FormData(ie)),Pe.isFormData(ie))return Oe&&Oe?JSON.stringify(ae(ie)):ie;if(Pe.isArrayBuffer(ie)||Pe.isBuffer(ie)||Pe.isStream(ie)||Pe.isFile(ie)||Pe.isBlob(ie))return ie;if(Pe.isArrayBufferView(ie))return ie.buffer;if(Pe.isURLSearchParams(ie))return de.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ie.toString();let Ne;if(Ae){if(ke.indexOf("application/x-www-form-urlencoded")>-1)return function(Be,Ke){return gt(Be,new Qt.classes.URLSearchParams,Object.assign({visitor:function(Qe,Ze,je,ft){return Qt.isNode&&Pe.isBuffer(Qe)?(this.append(Ze,Qe.toString("base64")),!1):ft.defaultVisitor.apply(this,arguments)}},Ke))}(ie,this.formSerializer).toString();if((Ne=Pe.isFileList(ie))||ke.indexOf("multipart/form-data")>-1){const Be=this.env&&this.env.FormData;return gt(Ne?{"files[]":ie}:ie,Be&&new Be,this.formSerializer)}}return Ae||Oe?(de.setContentType("application/json",!1),function(Be,Ke,Qe){if(Pe.isString(Be))try{return(0,JSON.parse)(Be),Pe.trim(Be)}catch(Ze){if(Ze.name!=="SyntaxError")throw Ze}return(0,JSON.stringify)(Be)}(ie)):ie}],transformResponse:[function(ie){const de=this.transitional||Q.transitional,ke=de&&de.forcedJSONParsing,Oe=this.responseType==="json";if(ie&&Pe.isString(ie)&&(ke&&!this.responseType||Oe)){const Ae=!(de&&de.silentJSONParsing)&&Oe;try{return JSON.parse(ie)}catch(Ne){if(Ae)throw Ne.name==="SyntaxError"?it.from(Ne,it.ERR_BAD_RESPONSE,this,null,this.response):Ne}}return ie}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(ie){return ie>=200&&ie<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Pe.forEach(["delete","get","head","post","put","patch"],ie=>{Q.headers[ie]={}});var X=Q;const he=Pe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Te=Symbol("internals");function $e(ie){return ie&&String(ie).trim().toLowerCase()}function Ue(ie){return ie===!1||ie==null?ie:Pe.isArray(ie)?ie.map(Ue):String(ie)}function ct(ie,de,ke,Oe,Ae){return Pe.isFunction(Oe)?Oe.call(this,de,ke):(Ae&&(de=ke),Pe.isString(de)?Pe.isString(Oe)?de.indexOf(Oe)!==-1:Pe.isRegExp(Oe)?Oe.test(de):void 0:void 0)}class kt{constructor(de){de&&this.set(de)}set(de,ke,Oe){const Ae=this;function Ne(Ke,Qe,Ze){const je=$e(Qe);if(!je)throw new Error("header name must be a non-empty string");const ft=Pe.findKey(Ae,je);(!ft||Ae[ft]===void 0||Ze===!0||Ze===void 0&&Ae[ft]!==!1)&&(Ae[ft||Qe]=Ue(Ke))}const Be=(Ke,Qe)=>Pe.forEach(Ke,(Ze,je)=>Ne(Ze,je,Qe));return Pe.isPlainObject(de)||de instanceof this.constructor?Be(de,ke):Pe.isString(de)&&(de=de.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(de.trim())?Be((Ke=>{const Qe={};let Ze,je,ft;return Ke&&Ke.split(`
|
|
4
|
-
`).forEach(function(
|
|
5
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(
|
|
6
|
-
|
|
7
|
-
`):" "+Re(Ne[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return Oe};function qe(ie){if(ie.cancelToken&&ie.cancelToken.throwIfRequested(),ie.signal&&ie.signal.aborted)throw new dn(null,ie)}function He(ie){return qe(ie),ie.headers=yt.from(ie.headers),ie.data=It.call(ie,ie.transformRequest),["post","put","patch"].indexOf(ie.method)!==-1&&ie.headers.setContentType("application/x-www-form-urlencoded",!1),Ce(ie.adapter||X.adapter)(ie).then(function(de){return qe(ie),de.data=It.call(ie,ie.transformResponse,de),de.headers=yt.from(de.headers),de},function(de){return St(de)||(qe(ie),de&&de.response&&(de.response.data=It.call(ie,ie.transformResponse,de.response),de.response.headers=yt.from(de.response.headers))),Promise.reject(de)})}const ze=ie=>ie instanceof yt?ie.toJSON():ie;function Fe(ie,de){de=de||{};const ke={};function Oe(Ze,je,ft){return Pe.isPlainObject(Ze)&&Pe.isPlainObject(je)?Pe.merge.call({caseless:ft},Ze,je):Pe.isPlainObject(je)?Pe.merge({},je):Pe.isArray(je)?je.slice():je}function Ae(Ze,je,ft){return Pe.isUndefined(je)?Pe.isUndefined(Ze)?void 0:Oe(void 0,Ze,ft):Oe(Ze,je,ft)}function Ne(Ze,je){if(!Pe.isUndefined(je))return Oe(void 0,je)}function Be(Ze,je){return Pe.isUndefined(je)?Pe.isUndefined(Ze)?void 0:Oe(void 0,Ze):Oe(void 0,je)}function Ke(Ze,je,ft){return ft in de?Oe(Ze,je):ft in ie?Oe(void 0,Ze):void 0}const Qe={url:Ne,method:Ne,data:Ne,baseURL:Be,transformRequest:Be,transformResponse:Be,paramsSerializer:Be,timeout:Be,timeoutMessage:Be,withCredentials:Be,withXSRFToken:Be,adapter:Be,responseType:Be,xsrfCookieName:Be,xsrfHeaderName:Be,onUploadProgress:Be,onDownloadProgress:Be,decompress:Be,maxContentLength:Be,maxBodyLength:Be,beforeRedirect:Be,transport:Be,httpAgent:Be,httpsAgent:Be,cancelToken:Be,socketPath:Be,responseEncoding:Be,validateStatus:Ke,headers:(Ze,je)=>Ae(ze(Ze),ze(je),!0)};return Pe.forEach(Object.keys(Object.assign({},ie,de)),function(Ze){const je=Qe[Ze]||Ae,ft=je(ie[Ze],de[Ze],Ze);Pe.isUndefined(ft)&&je!==Ke||(ke[Ze]=ft)}),ke}const Ve={};["object","boolean","number","function","string","symbol"].forEach((ie,de)=>{Ve[ie]=function(ke){return typeof ke===ie||"a"+(de<1?"n ":" ")+ie}});const Ge={};Ve.transitional=function(ie,de,ke){function Oe(Ae,Ne){return"[Axios v1.6.2] Transitional option '"+Ae+"'"+Ne+(ke?". "+ke:"")}return(Ae,Ne,Be)=>{if(ie===!1)throw new it(Oe(Ne," has been removed"+(de?" in "+de:"")),it.ERR_DEPRECATED);return de&&!Ge[Ne]&&(Ge[Ne]=!0,console.warn(Oe(Ne," has been deprecated since v"+de+" and will be removed in the near future"))),!ie||ie(Ae,Ne,Be)}};var tt={assertOptions:function(ie,de,ke){if(typeof ie!="object")throw new it("options must be an object",it.ERR_BAD_OPTION_VALUE);const Oe=Object.keys(ie);let Ae=Oe.length;for(;Ae-- >0;){const Ne=Oe[Ae],Be=de[Ne];if(Be){const Ke=ie[Ne],Qe=Ke===void 0||Be(Ke,Ne,ie);if(Qe!==!0)throw new it("option "+Ne+" must be "+Qe,it.ERR_BAD_OPTION_VALUE)}else if(ke!==!0)throw new it("Unknown option "+Ne,it.ERR_BAD_OPTION)}},validators:Ve};const ut=tt.validators;class vt{constructor(de){this.defaults=de,this.interceptors={request:new fn,response:new fn}}request(de,ke){typeof de=="string"?(ke=ke||{}).url=de:ke=de||{},ke=Fe(this.defaults,ke);const{transitional:Oe,paramsSerializer:Ae,headers:Ne}=ke;Oe!==void 0&&tt.assertOptions(Oe,{silentJSONParsing:ut.transitional(ut.boolean),forcedJSONParsing:ut.transitional(ut.boolean),clarifyTimeoutError:ut.transitional(ut.boolean)},!1),Ae!=null&&(Pe.isFunction(Ae)?ke.paramsSerializer={serialize:Ae}:tt.assertOptions(Ae,{encode:ut.function,serialize:ut.function},!0)),ke.method=(ke.method||this.defaults.method||"get").toLowerCase();let Be=Ne&&Pe.merge(Ne.common,Ne[ke.method]);Ne&&Pe.forEach(["delete","get","head","post","put","patch","common"],Ye=>{delete Ne[Ye]}),ke.headers=yt.concat(Be,Ne);const Ke=[];let Qe=!0;this.interceptors.request.forEach(function(Ye){typeof Ye.runWhen=="function"&&Ye.runWhen(ke)===!1||(Qe=Qe&&Ye.synchronous,Ke.unshift(Ye.fulfilled,Ye.rejected))});const Ze=[];let je;this.interceptors.response.forEach(function(Ye){Ze.push(Ye.fulfilled,Ye.rejected)});let ft,Xe=0;if(!Qe){const Ye=[He.bind(this),void 0];for(Ye.unshift.apply(Ye,Ke),Ye.push.apply(Ye,Ze),ft=Ye.length,je=Promise.resolve(ke);Xe<ft;)je=je.then(Ye[Xe++],Ye[Xe++]);return je}ft=Ke.length;let wt=ke;for(Xe=0;Xe<ft;){const Ye=Ke[Xe++],Ot=Ke[Xe++];try{wt=Ye(wt)}catch(Ft){Ot.call(this,Ft);break}}try{je=He.call(this,wt)}catch(Ye){return Promise.reject(Ye)}for(Xe=0,ft=Ze.length;Xe<ft;)je=je.then(Ze[Xe++],Ze[Xe++]);return je}getUri(de){return Kt(Gn((de=Fe(this.defaults,de)).baseURL,de.url),de.params,de.paramsSerializer)}}Pe.forEach(["delete","get","head","options"],function(ie){vt.prototype[ie]=function(de,ke){return this.request(Fe(ke||{},{method:ie,url:de,data:(ke||{}).data}))}}),Pe.forEach(["post","put","patch"],function(ie){function de(ke){return function(Oe,Ae,Ne){return this.request(Fe(Ne||{},{method:ie,headers:ke?{"Content-Type":"multipart/form-data"}:{},url:Oe,data:Ae}))}}vt.prototype[ie]=de(),vt.prototype[ie+"Form"]=de(!0)});var Mt=vt;class on{constructor(de){if(typeof de!="function")throw new TypeError("executor must be a function.");let ke;this.promise=new Promise(function(Ae){ke=Ae});const Oe=this;this.promise.then(Ae=>{if(!Oe._listeners)return;let Ne=Oe._listeners.length;for(;Ne-- >0;)Oe._listeners[Ne](Ae);Oe._listeners=null}),this.promise.then=Ae=>{let Ne;const Be=new Promise(Ke=>{Oe.subscribe(Ke),Ne=Ke}).then(Ae);return Be.cancel=function(){Oe.unsubscribe(Ne)},Be},de(function(Ae,Ne,Be){Oe.reason||(Oe.reason=new dn(Ae,Ne,Be),ke(Oe.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(de){this.reason?de(this.reason):this._listeners?this._listeners.push(de):this._listeners=[de]}unsubscribe(de){if(!this._listeners)return;const ke=this._listeners.indexOf(de);ke!==-1&&this._listeners.splice(ke,1)}static source(){let de;return{token:new on(function(ke){de=ke}),cancel:de}}}var gn=on;const $n={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($n).forEach(([ie,de])=>{$n[de]=ie});var Yn=$n;const Nt=function ie(de){const ke=new Mt(de),Oe=O(Mt.prototype.request,ke);return Pe.extend(Oe,Mt.prototype,ke,{allOwnKeys:!0}),Pe.extend(Oe,ke,null,{allOwnKeys:!0}),Oe.create=function(Ae){return ie(Fe(de,Ae))},Oe}(X);Nt.Axios=Mt,Nt.CanceledError=dn,Nt.CancelToken=gn,Nt.isCancel=St,Nt.VERSION="1.6.2",Nt.toFormData=gt,Nt.AxiosError=it,Nt.Cancel=Nt.CanceledError,Nt.all=function(ie){return Promise.all(ie)},Nt.spread=function(ie){return function(de){return ie.apply(null,de)}},Nt.isAxiosError=function(ie){return Pe.isObject(ie)&&ie.isAxiosError===!0},Nt.mergeConfig=Fe,Nt.AxiosHeaders=yt,Nt.formToJSON=ie=>ae(Pe.isHTMLForm(ie)?new FormData(ie):ie),Nt.getAdapter=Ce,Nt.HttpStatusCode=Yn,Nt.default=Nt,I.exports=Nt},147:I=>{I.exports=JSON.parse('{"name":"@pikaz/location","version":"1.0.9","description":"used to obtain location from the browser","private":false,"main":"lib/pikazLocation.js","module":"lib/pikazLocationModule.js","scripts":{"compress":"node utils/compress.js","analysisip":"node utils/analysisIp.js","build":"webpack && webpack --config module.config.js"},"keywords":["geolocation","location","longitude","latitude","province","city","district"],"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/pikaz-18/pikaz-location.git"},"author":"pikaz","license":"MIT","bugs":{"url":"https://github.com/pikaz-18/pikaz-location/issues"},"homepage":"https://github.com/pikaz-18/pikaz-location#readme","devDependencies":{"clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^10.2.0","object-hash":"^3.0.0","webpack":"^5.65.0","webpack-cli":"^4.9.1"},"dependencies":{"axios":"^1.6.2","localforage":"^1.10.0","lz-string":"^1.4.4","point-in-polygon":"^1.1.0"},"fileDate":{"areaList":"202212301139","city":"202212301139","district":"202212301139","ip":"2024532110","province":"202317042"},"fileCode":{"areaList":"64b5a33f94b14ae208fca152fdc89dca1048360a","city":"7827eb2bc906b83df109ab24242ce68f98f9558b","district":"14d77ce6236e2025a4b1e3900cc70d0c32a62d0b","ip":"befa0a8a45fdc238a0fb4e4a3011dae43a06c1b4","province":"629a3c20a32e0de95e0633e0385234e2b7886c2d"}}')}},q={};function J(I){var D=q[I];if(D!==void 0)return D.exports;var a=q[I]={exports:{}};return Z[I](a,a.exports,J),a.exports}return J.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),J(138)})()}},t$1={};function n(N){var Z=t$1[N];if(Z!==void 0)return Z.exports;var q=t$1[N]={exports:{}};return e$2[N].call(q.exports,q,q.exports,n),q.exports}n.n=N=>{var Z=N&&N.__esModule?()=>N.default:()=>N;return n.d(Z,{a:Z}),Z},n.d=(N,Z)=>{for(var q in Z)n.o(Z,q)&&!n.o(N,q)&&Object.defineProperty(N,q,{enumerable:!0,get:Z[q]})},n.o=(N,Z)=>Object.prototype.hasOwnProperty.call(N,Z);var r$1={};(()=>{n.d(r$1,{v6:()=>N.setConfig,k$:()=>N.getLocation,SG:()=>N.getH5Location,Qf:()=>N.getIpLocation,Mc:()=>N.searchList,kr:()=>N.searchCodeAddress,Gp:()=>N.searchAddress,I5:()=>N.searchCodeDetail,ZP:()=>Z});var N=n(782);const Z={setConfig:N.setConfig,getLocation:N.getLocation,getH5Location:N.getH5Location,getIpLocation:N.getIpLocation,searchList:N.searchList,searchCodeAddress:N.searchCodeAddress,searchAddress:N.searchAddress,searchCodeDetail:N.searchCodeDetail}})(),r$1.ZP,r$1.SG,r$1.Qf,r$1.k$,r$1.Gp,r$1.kr,r$1.I5,r$1.Mc,r$1.v6;const createMutedAudioStream=N=>{const Z=N.createOscillator();Z.type="sine",Z.frequency.setValueAtTime(0,N.currentTime);const q=N.createGain();q.gain.value=0,Z.connect(q),q.connect(N.destination),Z.start();const J=N.createMediaStreamDestination();return q.disconnect(),Z.connect(J),J.stream},createFakeVideoStream=(N=10,Z=10,q=30)=>{const J=document.createElement("canvas"),I=J.getContext("2d");J.width=N,J.height=Z;let D=0;return setInterval(()=>{I.clearRect(0,0,J.width,J.height);const F=I.createLinearGradient(0,0,J.width,J.height);F.addColorStop(0,`hsla(${D}, 100%, 50%, 0)`),F.addColorStop(1,`hsla(${D+120}, 100%, 50%, 0)`),I.fillStyle=F,I.fillRect(0,0,J.width,J.height),D=(D+1)%360},100),J.captureStream(q)};var E=Object.defineProperty,$=N=>{throw TypeError(N)},j=(N,Z,q)=>Z in N?E(N,Z,{enumerable:!0,configurable:!0,writable:!0,value:q}):N[Z]=q,u=(N,Z,q)=>j(N,typeof Z!="symbol"?Z+"":Z,q),B=(N,Z,q)=>Z.has(N)||$("Cannot "+q),o=(N,Z,q)=>(B(N,Z,"read from private field"),q?q.call(N):Z.get(N)),k=(N,Z,q)=>Z.has(N)?$("Cannot add the same private member more than once"):Z instanceof WeakSet?Z.add(N):Z.set(N,q),g$1=(N,Z,q,J)=>(B(N,Z,"write to private field"),Z.set(N,q),q),C=(N,Z,q,J)=>({set _(I){g$1(N,Z,I)},get _(){return o(N,Z,J)}}),d,r,c,m$1;class Y{constructor(Z,q={}){k(this,d,{debug:!1}),k(this,r,new Map),k(this,c,new Map),k(this,m$1,0),u(this,"setCondition",async(J,I)=>{if(!o(this,r).has(J))throw new Error("You have set an incorrect condition. If this is necessary, you need to define it first during instantiation.");const D=o(this,r).get(J);o(this,r).set(J,I),D===!1&&I&&await this.executeTasks()}),u(this,"createTask",async J=>{const I={describe:"",strict:!1,timeout:0,success:async ue=>{},fail:async ue=>{},complete:async()=>{},...J},{describe:D,strict:a,timeout:O,conditionKeys:F,changeConditionKeys:z=[],func:K,success:te,fail:ne,complete:ee}=I,re=`${C(this,m$1)._++}`,ce=()=>{let ue=!0;for(const _e of F)if(!o(this,r).get(_e)){ue=!1;break}return ue};let oe=0;const se=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${D} (${re}) end`),o(this,c).delete(re)},fe=async()=>{if(!o(this,c).get(re)||ge.runing)return;ge.runing=!0;for(const pe of z)this.setCondition(pe,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${D} (${re}) run`);const ue=ge.func(),_e=new Promise((pe,ye)=>{O&&(oe=setTimeout(()=>{ye(`task: ${re} (${D}) is timeout.`)},O))});return Promise.race([ue,_e]).finally(()=>{ge.strict===!1&&ge.clear(),clearTimeout(oe),ge.runing=!1,ee()}).then(pe=>{te(pe)}).catch(pe=>{ne(pe)})},ge={key:re,describe:D,strict:a,conditionKeys:F,runing:!1,func:K,checkAccord:ce,success:te,fail:ne,complete:ee,run:fe,retry:()=>(ge.runing=!1,fe()),clear:se};return o(this,c).set(re,ge),ge.checkAccord()&&setTimeout(()=>ge.run(),0),ge}),u(this,"executeTasks",async()=>{const J=[...o(this,c).values()];for(const I of J)I.checkAccord()&&I.run()}),u(this,"clear",(J=[])=>{if(J.length===0){g$1(this,c,new Map);return}for(const I of J)o(this,c).delete(I)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const J of Z)o(this,r).set(J,!0);g$1(this,d,{debug:!1,...q})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m$1=new WeakMap;class NetworkQualityTester{constructor(Z=[]){Ee(this,"targetUrls",[]);Ee(this,"results",[]);Z.length===0&&Z.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=Z,this.results=[]}async testAll(){const Z=this.targetUrls.map(q=>this.testUrl(q));return await Promise.all(Z),this.analyzeResults()}async testUrl(Z){const q=performance.now();let J=0,I=!1;try{await fetch(Z,{method:"HEAD",cache:"no-store"});const D=performance.now()-q,a=performance.now(),F=await(await fetch(Z,{cache:"no-store"})).blob(),z=performance.now()-a;J=F.size,I=!0,this.results.push({url:Z,success:I,headTime:D,getTime:z,size:J,downloadSpeed:J>0?(J/1024/(z/1e3)).toFixed(2):0,totalTime:performance.now()-q})}catch(D){this.results.push({url:Z,success:!1,error:D.message,totalTime:performance.now()-q})}}analyzeResults(){const Z=this.results.filter(D=>D.success);if(Z.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const q=Z.reduce((D,a)=>D+a.size,0),J=Z.reduce((D,a)=>D+a.totalTime,0),I=Z.reduce((D,a)=>D+parseFloat(a.downloadSpeed),0)/Z.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:Z.length,averageDownloadSpeed:`${I.toFixed(2)} KB/s`,averageResponseTime:`${(J/Z.length).toFixed(2)}ms`,totalDataTransferred:`${(q/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(N){(function(Z){var q="undefined",J=q!==typeof Buffer&&Buffer,I=q!==typeof Uint8Array&&Uint8Array,D=q!==typeof ArrayBuffer&&ArrayBuffer,a=[0,0,0,0,0,0,0,0],O=Array.isArray||pe,F=4294967296,z=16777216,K;te("Uint64BE",!0,!0),te("Int64BE",!0,!1),te("Uint64LE",!1,!0),te("Int64LE",!1,!1);function te(ye,we,Ie){var be=we?0:4,Se=we?4:0,Me=we?0:3,We=we?1:2,Je=we?2:1,Le=we?3:0,Tt=we?fe:ue,Et=we?ge:_e,At=_t.prototype,jt="is"+ye,Pt="_"+jt;return At.buffer=void 0,At.offset=0,At[Pt]=!0,At.toNumber=Pe,At.toString=it,At.toJSON=Pe,At.toArray=ne,J&&(At.toBuffer=ee),I&&(At.toArrayBuffer=re),_t[jt]=rt,Z[ye]=_t,_t;function _t(nt,et,ot,st){return this instanceof _t?Vt(this,nt,et,ot,st):new _t(nt,et,ot,st)}function rt(nt){return!!(nt&&nt[Pt])}function Vt(nt,et,ot,st,gt){if(I&&D&&(et instanceof D&&(et=new I(et)),st instanceof D&&(st=new I(st))),!et&&!ot&&!st&&!K){nt.buffer=se(a,0);return}if(!ce(et,ot)){var Dt=K||Array;gt=ot,st=et,ot=0,et=K===J?J.alloc(8):new Dt(8)}nt.buffer=et,nt.offset=ot|=0,q!==typeof st&&(typeof st=="string"?Rt(et,ot,st,gt||10):ce(st,gt)?oe(et,ot,st,gt):typeof gt=="number"?(zt(et,ot+be,st),zt(et,ot+Se,gt)):st>0?Tt(et,ot,st):st<0?Et(et,ot,st):oe(et,ot,a,0))}function Rt(nt,et,ot,st){var gt=0,Dt=ot.length,Ut=0,Lt=0;ot[0]==="-"&>++;for(var Zt=gt;gt<Dt;){var Kt=parseInt(ot[gt++],st);if(!(Kt>=0))break;Lt=Lt*st+Kt,Ut=Ut*st+Math.floor(Lt/F),Lt%=F}Zt&&(Ut=~Ut,Lt?Lt=F-Lt:Ut++),zt(nt,et+be,Ut),zt(nt,et+Se,Lt)}function Pe(){var nt=this.buffer,et=this.offset,ot=Bt(nt,et+be),st=Bt(nt,et+Se);return Ie||(ot|=0),ot?ot*F+st:st}function it(nt){var et=this.buffer,ot=this.offset,st=Bt(et,ot+be),gt=Bt(et,ot+Se),Dt="",Ut=!Ie&&st&2147483648;for(Ut&&(st=~st,gt=F-gt),nt=nt||10;;){var Lt=st%nt*F+gt;if(st=Math.floor(st/nt),gt=Math.floor(Lt/nt),Dt=(Lt%nt).toString(nt)+Dt,!st&&!gt)break}return Ut&&(Dt="-"+Dt),Dt}function zt(nt,et,ot){nt[et+Le]=ot&255,ot=ot>>8,nt[et+Je]=ot&255,ot=ot>>8,nt[et+We]=ot&255,ot=ot>>8,nt[et+Me]=ot&255}function Bt(nt,et){return nt[et+Me]*z+(nt[et+We]<<16)+(nt[et+Je]<<8)+nt[et+Le]}}function ne(ye){var we=this.buffer,Ie=this.offset;return K=null,ye!==!1&&O(we)?we.length===8?we:we.slice(Ie,Ie+8):se(we,Ie)}function ee(ye){var we=this.buffer,Ie=this.offset;return K=J,ye!==!1&&J.isBuffer(we)?we.length===8?we:we.slice(Ie,Ie+8):J.from(re.call(this,ye))}function re(ye){var we=this.buffer,Ie=this.offset,be=we.buffer;if(K=I,ye!==!1&&!we.offset&&be instanceof D)return be.byteLength===8?be:be.slice(Ie,Ie+8);var Se=new I(8);return oe(Se,0,we,Ie),Se.buffer}function ce(ye,we){var Ie=ye&&ye.length;return we|=0,Ie&&we+8<=Ie&&typeof ye[we]!="string"}function oe(ye,we,Ie,be){we|=0,be|=0;for(var Se=0;Se<8;Se++)ye[we++]=Ie[be++]&255}function se(ye,we){return Array.prototype.slice.call(ye,we,we+8)}function fe(ye,we,Ie){for(var be=we+8;be>we;)ye[--be]=Ie&255,Ie/=256}function ge(ye,we,Ie){var be=we+8;for(Ie++;be>we;)ye[--be]=-Ie&255^255,Ie/=256}function ue(ye,we,Ie){for(var be=we+8;we<be;)ye[we++]=Ie&255,Ie/=256}function _e(ye,we,Ie){var be=we+8;for(Ie++;we<be;)ye[we++]=-Ie&255^255,Ie/=256}function pe(ye){return!!ye&&Object.prototype.toString.call(ye)=="[object Array]"}})(typeof N.nodeName!="string"?N: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)
|
|
8
|
-
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 N=requireTools(),Z=requireTools(),q=requireEbmlID(),J=function(){function I(){this._schema=q.byEbmlID,this._buffers=[],this._stack=[]}return I.prototype.encode=function(D){var a=this;return N.concat(D.reduce(function(O,F){return O.concat(a.encodeChunk(F))},[])).buffer},I.prototype.encodeChunk=function(D){return D.type==="m"?D.isEnd?this.endTag(D):this.startTag(D):(D.data=Z.Buffer.from(D.data),this.writeTag(D)),this.flush()},I.prototype.flush=function(){var D=this._buffers;return this._buffers=[],D},I.prototype.getSchemaInfo=function(D){for(var a=Object.keys(this._schema).map(Number),O=0;O<a.length;O++){var F=a[O];if(this._schema[F].name===D)return new Z.Buffer(F.toString(16),"hex")}return null},I.prototype.writeTag=function(D){var a=D.name,O=this.getSchemaInfo(a),F=D.data;if(O==null)throw new Error("No schema entry found for "+a);var z=N.encodeTag(O,F);if(this._stack.length>0){var K=this._stack[this._stack.length-1];K.children.push({tagId:O,elm:D,children:[],data:z});return}this._buffers=this._buffers.concat(z)},I.prototype.startTag=function(D){var a=D.name,O=this.getSchemaInfo(a);if(O==null)throw new Error("No schema entry found for "+a);if(D.unknownSize){var F=N.encodeTag(O,new Z.Buffer(0),D.unknownSize);this._buffers=this._buffers.concat(F);return}var z={tagId:O,elm:D,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(z),this._stack.push(z)},I.prototype.endTag=function(D){D.name;var a=this._stack.pop();if(a==null)throw new Error("EBML structure is broken");if(a.elm.name!==D.name)throw new Error("EBML structure is broken");var O=a.children.reduce(function(z,K){if(K.data===null)throw new Error("EBML structure is broken");return z.concat(K.data)},[]),F=N.concat(O);a.elm.type==="m"?a.data=N.encodeTag(a.tagId,F,a.elm.unknownSize):a.data=N.encodeTag(a.tagId,F),this._stack.length<1&&(this._buffers=this._buffers.concat(a.data))},I}();return EBMLEncoder.default=J,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=O,base64Js.toByteArray=z,base64Js.fromByteArray=ne;for(var N=[],Z=[],q=typeof Uint8Array<"u"?Uint8Array:Array,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=0,D=J.length;I<D;++I)N[I]=J[I],Z[J.charCodeAt(I)]=I;Z[45]=62,Z[95]=63;function a(ee){var re=ee.length;if(re%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ce=ee.indexOf("=");ce===-1&&(ce=re);var oe=ce===re?0:4-ce%4;return[ce,oe]}function O(ee){var re=a(ee),ce=re[0],oe=re[1];return(ce+oe)*3/4-oe}function F(ee,re,ce){return(re+ce)*3/4-ce}function z(ee){var re,ce=a(ee),oe=ce[0],se=ce[1],fe=new q(F(ee,oe,se)),ge=0,ue=se>0?oe-4:oe,_e;for(_e=0;_e<ue;_e+=4)re=Z[ee.charCodeAt(_e)]<<18|Z[ee.charCodeAt(_e+1)]<<12|Z[ee.charCodeAt(_e+2)]<<6|Z[ee.charCodeAt(_e+3)],fe[ge++]=re>>16&255,fe[ge++]=re>>8&255,fe[ge++]=re&255;return se===2&&(re=Z[ee.charCodeAt(_e)]<<2|Z[ee.charCodeAt(_e+1)]>>4,fe[ge++]=re&255),se===1&&(re=Z[ee.charCodeAt(_e)]<<10|Z[ee.charCodeAt(_e+1)]<<4|Z[ee.charCodeAt(_e+2)]>>2,fe[ge++]=re>>8&255,fe[ge++]=re&255),fe}function K(ee){return N[ee>>18&63]+N[ee>>12&63]+N[ee>>6&63]+N[ee&63]}function te(ee,re,ce){for(var oe,se=[],fe=re;fe<ce;fe+=3)oe=(ee[fe]<<16&16711680)+(ee[fe+1]<<8&65280)+(ee[fe+2]&255),se.push(K(oe));return se.join("")}function ne(ee){for(var re,ce=ee.length,oe=ce%3,se=[],fe=16383,ge=0,ue=ce-oe;ge<ue;ge+=fe)se.push(te(ee,ge,ge+fe>ue?ue:ge+fe));return oe===1?(re=ee[ce-1],se.push(N[re>>2]+N[re<<4&63]+"==")):oe===2&&(re=(ee[ce-2]<<8)+ee[ce-1],se.push(N[re>>10]+N[re>>4&63]+N[re<<2&63]+"=")),se.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(N,Z,q,J,I){var D,a,O=I*8-J-1,F=(1<<O)-1,z=F>>1,K=-7,te=q?I-1:0,ne=q?-1:1,ee=N[Z+te];for(te+=ne,D=ee&(1<<-K)-1,ee>>=-K,K+=O;K>0;D=D*256+N[Z+te],te+=ne,K-=8);for(a=D&(1<<-K)-1,D>>=-K,K+=J;K>0;a=a*256+N[Z+te],te+=ne,K-=8);if(D===0)D=1-z;else{if(D===F)return a?NaN:(ee?-1:1)*(1/0);a=a+Math.pow(2,J),D=D-z}return(ee?-1:1)*a*Math.pow(2,D-J)},ieee754.write=function(N,Z,q,J,I,D){var a,O,F,z=D*8-I-1,K=(1<<z)-1,te=K>>1,ne=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,ee=J?0:D-1,re=J?1:-1,ce=Z<0||Z===0&&1/Z<0?1:0;for(Z=Math.abs(Z),isNaN(Z)||Z===1/0?(O=isNaN(Z)?1:0,a=K):(a=Math.floor(Math.log(Z)/Math.LN2),Z*(F=Math.pow(2,-a))<1&&(a--,F*=2),a+te>=1?Z+=ne/F:Z+=ne*Math.pow(2,1-te),Z*F>=2&&(a++,F/=2),a+te>=K?(O=0,a=K):a+te>=1?(O=(Z*F-1)*Math.pow(2,I),a=a+te):(O=Z*Math.pow(2,te-1)*Math.pow(2,I),a=0));I>=8;N[q+ee]=O&255,ee+=re,O/=256,I-=8);for(a=a<<I|O,z+=I;z>0;N[q+ee]=a&255,ee+=re,a/=256,z-=8);N[q+ee-re]|=ce*128}),ieee754}/*!
|
|
3
|
+
`},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var $=requireParser(),z=requireWriter$1(),D=requireGrammar();return lib$1.grammar=D,lib$1.write=z,lib$1.parse=$.parse,lib$1.parseParams=$.parseParams,lib$1.parseFmtpConfig=$.parseFmtpConfig,lib$1.parsePayloads=$.parsePayloads,lib$1.parseRemoteCandidates=$.parseRemoteCandidates,lib$1.parseImageAttributes=$.parseImageAttributes,lib$1.parseSimulcastStreamList=$.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(z){Se(this,"kind","video");Se(this,"stream",new MediaStream);Se(this,"stop",()=>{const z=this.stream.getTracks();for(const D of z)D.stop(),this.stream.removeTrack(D)});Se(this,"replaceStream",z=>{const D=this.stream,j=D.getTracks();for(const I of j)D.removeTrack(I);const[O]=z.getVideoTracks();O&&D.addTrack(O)});Se(this,"getStream",()=>this.stream);Se(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(z)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C=Object.defineProperty,R=$=>{throw TypeError($)},S=($,z,D)=>z in $?C($,z,{enumerable:!0,configurable:!0,writable:!0,value:D}):$[z]=D,l$1=($,z,D)=>S($,typeof z!="symbol"?z+"":z,D),v=($,z,D)=>z.has($)||R("Cannot "+D),t$2=($,z,D)=>(v($,z,"read from private field"),D?D.call($):z.get($)),c=($,z,D)=>z.has($)?R("Cannot add the same private member more than once"):z instanceof WeakSet?z.add($):z.set($,D),i=($,z,D,j)=>(v($,z,"write to private field"),z.set($,D),D),s$1,r$1,h,p$1,m$1,f,w,x$1,g$1,b,B,y$1,T,d$1;class M{constructor(z){c(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:D=>!0,onReconnectSuccess:async D=>{},onReconnectStop:async D=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:D=>{}}),l$1(this,"ws"),c(this,r$1,-1),c(this,h,-1),c(this,p$1,0),c(this,m$1,0),c(this,f,!1),c(this,w,D=>{}),l$1(this,"close",async(D=1e3,j="correctly close.")=>{var O;this.ws&&(i(this,f,!0),t$2(this,d$1).call(this),(O=this.ws)==null||O.close(D,j))}),l$1(this,"connect",()=>new Promise(async D=>{i(this,w,D),this.ws=new WebSocket(t$2(this,s$1).url),this.ws.binaryType=t$2(this,s$1).binaryType,this.ws.onopen=t$2(this,b),this.ws.onmessage=t$2(this,g$1),this.ws.onerror=t$2(this,B),this.ws.onclose=t$2(this,y$1)})),l$1(this,"reconnect",async D=>new Promise(j=>{t$2(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 O=I=>{t$2(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${I}`),t$2(this,s$1).onReconnectStop({msg:I}),j(I)};if(t$2(this,x$1).call(this)===!1)return O("stop reconnect. exceed maxReconnectionTime.");if(t$2(this,r$1)!==-1&&t$2(this,r$1)===0)return O("stop reconnect. surplusReconnectCount is 0.");if(!t$2(this,s$1).checkReconnect(D))return O("stop reconnect. checkReconnect is false.");t$2(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$2(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$2(this,r$1)}`,D),i(this,p$1,setTimeout(async()=>{i(this,r$1,Math.max(-1,t$2(this,r$1)-1)),await this.connect();try{await t$2(this,s$1).onReconnectSuccess(this.ws)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",I)}j(!0)},t$2(this,s$1).reconnectIntervalTime))})),l$1(this,"sendMessage",async D=>{var j;(!this.ws||this.ws.readyState!==1)&&(t$2(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$2(this,s$1).sendBeforAutoConnect&&(t$2(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())),(j=this.ws)==null||j.send(D)}),c(this,x$1,()=>{const D=Date.now();return t$2(this,h)===-1&&i(this,h,D+t$2(this,s$1).reconnectTime),!(D>t$2(this,h))}),c(this,g$1,D=>{const{data:j}=D;t$2(this,s$1).onMessage(j)}),c(this,b,()=>{t$2(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(this,r$1,t$2(this,s$1).reconnectCount),i(this,h,-1),t$2(this,T).call(this),t$2(this,w).call(this,this.ws)}),c(this,B,D=>{t$2(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.",D)}),c(this,y$1,D=>{if(t$2(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: ${D.code}, permanentClosed is ${t$2(this,f)}.`,D),t$2(this,d$1).call(this),!t$2(this,f))return this.reconnect(D);this.ws=void 0}),c(this,T,()=>{i(this,m$1,setInterval(()=>{const D=t$2(this,s$1).getHeartbeatMsg();D&&this.sendMessage(D)},t$2(this,s$1).heartbeatIntervalTime))}),c(this,d$1,()=>{clearInterval(t$2(this,p$1)),clearInterval(t$2(this,m$1))}),i(this,s$1,{...t$2(this,s$1),...z}),i(this,r$1,t$2(this,s$1).reconnectCount)}}s$1=new WeakMap,r$1=new WeakMap,h=new WeakMap,p$1=new WeakMap,m$1=new WeakMap,f=new WeakMap,w=new WeakMap,x$1=new WeakMap,g$1=new WeakMap,b=new WeakMap,B=new WeakMap,y$1=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=$;function $(z,D){for(var j=new Array(arguments.length-1),O=0,I=2,o=!0;I<arguments.length;)j[O++]=arguments[I++];return new Promise(function(N,F){j[O]=function(X){if(o)if(o=!1,X)F(X);else{for(var Y=new Array(arguments.length-1),Q=0;Q<Y.length;)Y[Q++]=arguments[Q];N.apply(null,Y)}};try{z.apply(D||null,j)}catch(J){o&&(o=!1,F(J))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function($){var z=$;z.length=function(k){var N=k.length;if(!N)return 0;for(var F=0;--N%4>1&&k.charAt(N)==="=";)++F;return Math.ceil(k.length*3)/4-F};for(var D=new Array(64),j=new Array(123),O=0;O<64;)j[D[O]=O<26?O+65:O<52?O+71:O<62?O-4:O-59|43]=O++;z.encode=function(k,N,F){for(var J=null,X=[],Y=0,Q=0,te;N<F;){var ie=k[N++];switch(Q){case 0:X[Y++]=D[ie>>2],te=(ie&3)<<4,Q=1;break;case 1:X[Y++]=D[te|ie>>4],te=(ie&15)<<2,Q=2;break;case 2:X[Y++]=D[te|ie>>6],X[Y++]=D[ie&63],Q=0;break}Y>8191&&((J||(J=[])).push(String.fromCharCode.apply(String,X)),Y=0)}return Q&&(X[Y++]=D[te],X[Y++]=61,Q===1&&(X[Y++]=61)),J?(Y&&J.push(String.fromCharCode.apply(String,X.slice(0,Y))),J.join("")):String.fromCharCode.apply(String,X.slice(0,Y))};var I="invalid encoding";z.decode=function(k,N,F){for(var J=F,X=0,Y,Q=0;Q<k.length;){var te=k.charCodeAt(Q++);if(te===61&&X>1)break;if((te=j[te])===void 0)throw Error(I);switch(X){case 0:Y=te,X=1;break;case 1:N[F++]=Y<<2|(te&48)>>4,Y=te,X=2;break;case 2:N[F++]=(Y&15)<<4|(te&60)>>2,Y=te,X=3;break;case 3:N[F++]=(Y&3)<<6|te,X=0;break}}if(X===1)throw Error(I);return F-J},z.test=function(k){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(k)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=$;function $(){this._listeners={}}return $.prototype.on=function(D,j,O){return(this._listeners[D]||(this._listeners[D]=[])).push({fn:j,ctx:O||this}),this},$.prototype.off=function(D,j){if(D===void 0)this._listeners={};else if(j===void 0)this._listeners[D]=[];else for(var O=this._listeners[D],I=0;I<O.length;)O[I].fn===j?O.splice(I,1):++I;return this},$.prototype.emit=function(D){var j=this._listeners[D];if(j){for(var O=[],I=1;I<arguments.length;)O.push(arguments[I++]);for(I=0;I<j.length;)j[I].fn.apply(j[I++].ctx,O)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=$($);function $(I){return typeof Float32Array<"u"?function(){var o=new Float32Array([-0]),k=new Uint8Array(o.buffer),N=k[3]===128;function F(Q,te,ie){o[0]=Q,te[ie]=k[0],te[ie+1]=k[1],te[ie+2]=k[2],te[ie+3]=k[3]}function J(Q,te,ie){o[0]=Q,te[ie]=k[3],te[ie+1]=k[2],te[ie+2]=k[1],te[ie+3]=k[0]}I.writeFloatLE=N?F:J,I.writeFloatBE=N?J:F;function X(Q,te){return k[0]=Q[te],k[1]=Q[te+1],k[2]=Q[te+2],k[3]=Q[te+3],o[0]}function Y(Q,te){return k[3]=Q[te],k[2]=Q[te+1],k[1]=Q[te+2],k[0]=Q[te+3],o[0]}I.readFloatLE=N?X:Y,I.readFloatBE=N?Y:X}():function(){function o(N,F,J,X){var Y=F<0?1:0;if(Y&&(F=-F),F===0)N(1/F>0?0:2147483648,J,X);else if(isNaN(F))N(2143289344,J,X);else if(F>34028234663852886e22)N((Y<<31|2139095040)>>>0,J,X);else if(F<11754943508222875e-54)N((Y<<31|Math.round(F/1401298464324817e-60))>>>0,J,X);else{var Q=Math.floor(Math.log(F)/Math.LN2),te=Math.round(F*Math.pow(2,-Q)*8388608)&8388607;N((Y<<31|Q+127<<23|te)>>>0,J,X)}}I.writeFloatLE=o.bind(null,z),I.writeFloatBE=o.bind(null,D);function k(N,F,J){var X=N(F,J),Y=(X>>31)*2+1,Q=X>>>23&255,te=X&8388607;return Q===255?te?NaN:Y*(1/0):Q===0?Y*1401298464324817e-60*te:Y*Math.pow(2,Q-150)*(te+8388608)}I.readFloatLE=k.bind(null,j),I.readFloatBE=k.bind(null,O)}(),typeof Float64Array<"u"?function(){var o=new Float64Array([-0]),k=new Uint8Array(o.buffer),N=k[7]===128;function F(Q,te,ie){o[0]=Q,te[ie]=k[0],te[ie+1]=k[1],te[ie+2]=k[2],te[ie+3]=k[3],te[ie+4]=k[4],te[ie+5]=k[5],te[ie+6]=k[6],te[ie+7]=k[7]}function J(Q,te,ie){o[0]=Q,te[ie]=k[7],te[ie+1]=k[6],te[ie+2]=k[5],te[ie+3]=k[4],te[ie+4]=k[3],te[ie+5]=k[2],te[ie+6]=k[1],te[ie+7]=k[0]}I.writeDoubleLE=N?F:J,I.writeDoubleBE=N?J:F;function X(Q,te){return k[0]=Q[te],k[1]=Q[te+1],k[2]=Q[te+2],k[3]=Q[te+3],k[4]=Q[te+4],k[5]=Q[te+5],k[6]=Q[te+6],k[7]=Q[te+7],o[0]}function Y(Q,te){return k[7]=Q[te],k[6]=Q[te+1],k[5]=Q[te+2],k[4]=Q[te+3],k[3]=Q[te+4],k[2]=Q[te+5],k[1]=Q[te+6],k[0]=Q[te+7],o[0]}I.readDoubleLE=N?X:Y,I.readDoubleBE=N?Y:X}():function(){function o(N,F,J,X,Y,Q){var te=X<0?1:0;if(te&&(X=-X),X===0)N(0,Y,Q+F),N(1/X>0?0:2147483648,Y,Q+J);else if(isNaN(X))N(0,Y,Q+F),N(2146959360,Y,Q+J);else if(X>17976931348623157e292)N(0,Y,Q+F),N((te<<31|2146435072)>>>0,Y,Q+J);else{var ie;if(X<22250738585072014e-324)ie=X/5e-324,N(ie>>>0,Y,Q+F),N((te<<31|ie/4294967296)>>>0,Y,Q+J);else{var ne=Math.floor(Math.log(X)/Math.LN2);ne===1024&&(ne=1023),ie=X*Math.pow(2,-ne),N(ie*4503599627370496>>>0,Y,Q+F),N((te<<31|ne+1023<<20|ie*1048576&1048575)>>>0,Y,Q+J)}}}I.writeDoubleLE=o.bind(null,z,0,4),I.writeDoubleBE=o.bind(null,D,4,0);function k(N,F,J,X,Y){var Q=N(X,Y+F),te=N(X,Y+J),ie=(te>>31)*2+1,ne=te>>>20&2047,oe=4294967296*(te&1048575)+Q;return ne===2047?oe?NaN:ie*(1/0):ne===0?ie*5e-324*oe:ie*Math.pow(2,ne-1075)*(oe+4503599627370496)}I.readDoubleLE=k.bind(null,j,0,4),I.readDoubleBE=k.bind(null,O,4,0)}(),I}function z(I,o,k){o[k]=I&255,o[k+1]=I>>>8&255,o[k+2]=I>>>16&255,o[k+3]=I>>>24}function D(I,o,k){o[k]=I>>>24,o[k+1]=I>>>16&255,o[k+2]=I>>>8&255,o[k+3]=I&255}function j(I,o){return(I[o]|I[o+1]<<8|I[o+2]<<16|I[o+3]<<24)>>>0}function O(I,o){return(I[o]<<24|I[o+1]<<16|I[o+2]<<8|I[o+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch($){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function($){var z=$;z.length=function(j){for(var O=0,I=0,o=0;o<j.length;++o)I=j.charCodeAt(o),I<128?O+=1:I<2048?O+=2:(I&64512)===55296&&(j.charCodeAt(o+1)&64512)===56320?(++o,O+=4):O+=3;return O},z.read=function(j,O,I){var o=I-O;if(o<1)return"";for(var k=null,N=[],F=0,J;O<I;)J=j[O++],J<128?N[F++]=J:J>191&&J<224?N[F++]=(J&31)<<6|j[O++]&63:J>239&&J<365?(J=((J&7)<<18|(j[O++]&63)<<12|(j[O++]&63)<<6|j[O++]&63)-65536,N[F++]=55296+(J>>10),N[F++]=56320+(J&1023)):N[F++]=(J&15)<<12|(j[O++]&63)<<6|j[O++]&63,F>8191&&((k||(k=[])).push(String.fromCharCode.apply(String,N)),F=0);return k?(F&&k.push(String.fromCharCode.apply(String,N.slice(0,F))),k.join("")):String.fromCharCode.apply(String,N.slice(0,F))},z.write=function(j,O,I){for(var o=I,k,N,F=0;F<j.length;++F)k=j.charCodeAt(F),k<128?O[I++]=k:k<2048?(O[I++]=k>>6|192,O[I++]=k&63|128):(k&64512)===55296&&((N=j.charCodeAt(F+1))&64512)===56320?(k=65536+((k&1023)<<10)+(N&1023),++F,O[I++]=k>>18|240,O[I++]=k>>12&63|128,O[I++]=k>>6&63|128,O[I++]=k&63|128):(O[I++]=k>>12|224,O[I++]=k>>6&63|128,O[I++]=k&63|128);return I-o}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=$;function $(z,D,j){var O=j||8192,I=O>>>1,o=null,k=O;return function(F){if(F<1||F>I)return z(F);k+F>O&&(o=z(O),k=0);var J=D.call(o,k,k+=F);return k&7&&(k=(k|7)+1),J}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=z;var $=requireMinimal$1();function z(I,o){this.lo=I>>>0,this.hi=o>>>0}var D=z.zero=new z(0,0);D.toNumber=function(){return 0},D.zzEncode=D.zzDecode=function(){return this},D.length=function(){return 1};var j=z.zeroHash="\0\0\0\0\0\0\0\0";z.fromNumber=function(o){if(o===0)return D;var k=o<0;k&&(o=-o);var N=o>>>0,F=(o-N)/4294967296>>>0;return k&&(F=~F>>>0,N=~N>>>0,++N>4294967295&&(N=0,++F>4294967295&&(F=0))),new z(N,F)},z.from=function(o){if(typeof o=="number")return z.fromNumber(o);if($.isString(o))if($.Long)o=$.Long.fromString(o);else return z.fromNumber(parseInt(o,10));return o.low||o.high?new z(o.low>>>0,o.high>>>0):D},z.prototype.toNumber=function(o){if(!o&&this.hi>>>31){var k=~this.lo+1>>>0,N=~this.hi>>>0;return k||(N=N+1>>>0),-(k+N*4294967296)}return this.lo+this.hi*4294967296},z.prototype.toLong=function(o){return $.Long?new $.Long(this.lo|0,this.hi|0,!!o):{low:this.lo|0,high:this.hi|0,unsigned:!!o}};var O=String.prototype.charCodeAt;return z.fromHash=function(o){return o===j?D:new z((O.call(o,0)|O.call(o,1)<<8|O.call(o,2)<<16|O.call(o,3)<<24)>>>0,(O.call(o,4)|O.call(o,5)<<8|O.call(o,6)<<16|O.call(o,7)<<24)>>>0)},z.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},z.prototype.zzEncode=function(){var o=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^o)>>>0,this.lo=(this.lo<<1^o)>>>0,this},z.prototype.zzDecode=function(){var o=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^o)>>>0,this.hi=(this.hi>>>1^o)>>>0,this},z.prototype.length=function(){var o=this.lo,k=(this.lo>>>28|this.hi<<4)>>>0,N=this.hi>>>24;return N===0?k===0?o<16384?o<128?1:2:o<2097152?3:4:k<16384?k<128?5:6:k<2097152?7:8:N<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function($){var z=$;z.asPromise=requireAspromise(),z.base64=requireBase64(),z.EventEmitter=requireEventemitter(),z.float=requireFloat(),z.inquire=requireInquire(),z.utf8=requireUtf8(),z.pool=requirePool(),z.LongBits=requireLongbits(),z.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),z.global=z.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,z.emptyArray=Object.freeze?Object.freeze([]):[],z.emptyObject=Object.freeze?Object.freeze({}):{},z.isInteger=Number.isInteger||function(I){return typeof I=="number"&&isFinite(I)&&Math.floor(I)===I},z.isString=function(I){return typeof I=="string"||I instanceof String},z.isObject=function(I){return I&&typeof I=="object"},z.isset=z.isSet=function(I,o){var k=I[o];return k!=null&&I.hasOwnProperty(o)?typeof k!="object"||(Array.isArray(k)?k.length:Object.keys(k).length)>0:!1},z.Buffer=function(){try{var O=z.inquire("buffer").Buffer;return O.prototype.utf8Write?O:null}catch{return null}}(),z._Buffer_from=null,z._Buffer_allocUnsafe=null,z.newBuffer=function(I){return typeof I=="number"?z.Buffer?z._Buffer_allocUnsafe(I):new z.Array(I):z.Buffer?z._Buffer_from(I):typeof Uint8Array>"u"?I:new Uint8Array(I)},z.Array=typeof Uint8Array<"u"?Uint8Array:Array,z.Long=z.global.dcodeIO&&z.global.dcodeIO.Long||z.global.Long||z.inquire("long"),z.key2Re=/^true|false|0|1$/,z.key32Re=/^-?(?:0|[1-9][0-9]*)$/,z.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,z.longToHash=function(I){return I?z.LongBits.from(I).toHash():z.LongBits.zeroHash},z.longFromHash=function(I,o){var k=z.LongBits.fromHash(I);return z.Long?z.Long.fromBits(k.lo,k.hi,o):k.toNumber(!!o)};function D(O,I,o){for(var k=Object.keys(I),N=0;N<k.length;++N)(O[k[N]]===void 0||!o)&&(O[k[N]]=I[k[N]]);return O}z.merge=D,z.lcFirst=function(I){return I.charAt(0).toLowerCase()+I.substring(1)};function j(O){function I(o,k){if(!(this instanceof I))return new I(o,k);Object.defineProperty(this,"message",{get:function(){return o}}),Error.captureStackTrace?Error.captureStackTrace(this,I):Object.defineProperty(this,"stack",{value:new Error().stack||""}),k&&D(this,k)}return I.prototype=Object.create(Error.prototype,{constructor:{value:I,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return O},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),I}z.newError=j,z.ProtocolError=j("ProtocolError"),z.oneOfGetter=function(I){for(var o={},k=0;k<I.length;++k)o[I[k]]=1;return function(){for(var N=Object.keys(this),F=N.length-1;F>-1;--F)if(o[N[F]]===1&&this[N[F]]!==void 0&&this[N[F]]!==null)return N[F]}},z.oneOfSetter=function(I){return function(o){for(var k=0;k<I.length;++k)I[k]!==o&&delete this[I[k]]}},z.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},z._configure=function(){var O=z.Buffer;if(!O){z._Buffer_from=z._Buffer_allocUnsafe=null;return}z._Buffer_from=O.from!==Uint8Array.from&&O.from||function(o,k){return new O(o,k)},z._Buffer_allocUnsafe=O.allocUnsafe||function(o){return new O(o)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=N;var $=requireMinimal$1(),z,D=$.LongBits,j=$.base64,O=$.utf8;function I(ne,oe,ce){this.fn=ne,this.len=oe,this.next=void 0,this.val=ce}function o(){}function k(ne){this.head=ne.head,this.tail=ne.tail,this.len=ne.len,this.next=ne.states}function N(){this.len=0,this.head=new I(o,0,0),this.tail=this.head,this.states=null}var F=function(){return $.Buffer?function(){return(N.create=function(){return new z})()}:function(){return new N}};N.create=F(),N.alloc=function(oe){return new $.Array(oe)},$.Array!==Array&&(N.alloc=$.pool(N.alloc,$.Array.prototype.subarray)),N.prototype._push=function(oe,ce,we){return this.tail=this.tail.next=new I(oe,ce,we),this.len+=ce,this};function J(ne,oe,ce){oe[ce]=ne&255}function X(ne,oe,ce){for(;ne>127;)oe[ce++]=ne&127|128,ne>>>=7;oe[ce]=ne}function Y(ne,oe){this.len=ne,this.next=void 0,this.val=oe}Y.prototype=Object.create(I.prototype),Y.prototype.fn=X,N.prototype.uint32=function(oe){return this.len+=(this.tail=this.tail.next=new Y((oe=oe>>>0)<128?1:oe<16384?2:oe<2097152?3:oe<268435456?4:5,oe)).len,this},N.prototype.int32=function(oe){return oe<0?this._push(Q,10,D.fromNumber(oe)):this.uint32(oe)},N.prototype.sint32=function(oe){return this.uint32((oe<<1^oe>>31)>>>0)};function Q(ne,oe,ce){for(;ne.hi;)oe[ce++]=ne.lo&127|128,ne.lo=(ne.lo>>>7|ne.hi<<25)>>>0,ne.hi>>>=7;for(;ne.lo>127;)oe[ce++]=ne.lo&127|128,ne.lo=ne.lo>>>7;oe[ce++]=ne.lo}N.prototype.uint64=function(oe){var ce=D.from(oe);return this._push(Q,ce.length(),ce)},N.prototype.int64=N.prototype.uint64,N.prototype.sint64=function(oe){var ce=D.from(oe).zzEncode();return this._push(Q,ce.length(),ce)},N.prototype.bool=function(oe){return this._push(J,1,oe?1:0)};function te(ne,oe,ce){oe[ce]=ne&255,oe[ce+1]=ne>>>8&255,oe[ce+2]=ne>>>16&255,oe[ce+3]=ne>>>24}N.prototype.fixed32=function(oe){return this._push(te,4,oe>>>0)},N.prototype.sfixed32=N.prototype.fixed32,N.prototype.fixed64=function(oe){var ce=D.from(oe);return this._push(te,4,ce.lo)._push(te,4,ce.hi)},N.prototype.sfixed64=N.prototype.fixed64,N.prototype.float=function(oe){return this._push($.float.writeFloatLE,4,oe)},N.prototype.double=function(oe){return this._push($.float.writeDoubleLE,8,oe)};var ie=$.Array.prototype.set?function(oe,ce,we){ce.set(oe,we)}:function(oe,ce,we){for(var se=0;se<oe.length;++se)ce[we+se]=oe[se]};return N.prototype.bytes=function(oe){var ce=oe.length>>>0;if(!ce)return this._push(J,1,0);if($.isString(oe)){var we=N.alloc(ce=j.length(oe));j.decode(oe,we,0),oe=we}return this.uint32(ce)._push(ie,ce,oe)},N.prototype.string=function(oe){var ce=O.length(oe);return ce?this.uint32(ce)._push(O.write,ce,oe):this._push(J,1,0)},N.prototype.fork=function(){return this.states=new k(this),this.head=this.tail=new I(o,0,0),this.len=0,this},N.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new I(o,0,0),this.len=0),this},N.prototype.ldelim=function(){var oe=this.head,ce=this.tail,we=this.len;return this.reset().uint32(we),we&&(this.tail.next=oe.next,this.tail=ce,this.len+=we),this},N.prototype.finish=function(){for(var oe=this.head.next,ce=this.constructor.alloc(this.len),we=0;oe;)oe.fn(oe.val,ce,we),we+=oe.len,oe=oe.next;return ce},N._configure=function(ne){z=ne,N.create=F(),z._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=D;var $=requireWriter();(D.prototype=Object.create($.prototype)).constructor=D;var z=requireMinimal$1();function D(){$.call(this)}D._configure=function(){D.alloc=z._Buffer_allocUnsafe,D.writeBytesBuffer=z.Buffer&&z.Buffer.prototype instanceof Uint8Array&&z.Buffer.prototype.set.name==="set"?function(I,o,k){o.set(I,k)}:function(I,o,k){if(I.copy)I.copy(o,k,0,I.length);else for(var N=0;N<I.length;)o[k++]=I[N++]}},D.prototype.bytes=function(I){z.isString(I)&&(I=z._Buffer_from(I,"base64"));var o=I.length>>>0;return this.uint32(o),o&&this._push(D.writeBytesBuffer,o,I),this};function j(O,I,o){O.length<40?z.utf8.write(O,I,o):I.utf8Write?I.utf8Write(O,o):I.write(O,o)}return D.prototype.string=function(I){var o=z.Buffer.byteLength(I);return this.uint32(o),o&&this._push(j,o,I),this},D._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=I;var $=requireMinimal$1(),z,D=$.LongBits,j=$.utf8;function O(X,Y){return RangeError("index out of range: "+X.pos+" + "+(Y||1)+" > "+X.len)}function I(X){this.buf=X,this.pos=0,this.len=X.length}var o=typeof Uint8Array<"u"?function(Y){if(Y instanceof Uint8Array||Array.isArray(Y))return new I(Y);throw Error("illegal buffer")}:function(Y){if(Array.isArray(Y))return new I(Y);throw Error("illegal buffer")},k=function(){return $.Buffer?function(Q){return(I.create=function(ie){return $.Buffer.isBuffer(ie)?new z(ie):o(ie)})(Q)}:o};I.create=k(),I.prototype._slice=$.Array.prototype.subarray||$.Array.prototype.slice,I.prototype.uint32=function(){var Y=4294967295;return function(){if(Y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(Y=(Y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(Y=(Y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(Y=(Y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(Y=(Y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return Y;if((this.pos+=5)>this.len)throw this.pos=this.len,O(this,10);return Y}}(),I.prototype.int32=function(){return this.uint32()|0},I.prototype.sint32=function(){var Y=this.uint32();return Y>>>1^-(Y&1)|0};function N(){var X=new D(0,0),Y=0;if(this.len-this.pos>4){for(;Y<4;++Y)if(X.lo=(X.lo|(this.buf[this.pos]&127)<<Y*7)>>>0,this.buf[this.pos++]<128)return X;if(X.lo=(X.lo|(this.buf[this.pos]&127)<<28)>>>0,X.hi=(X.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return X;Y=0}else{for(;Y<3;++Y){if(this.pos>=this.len)throw O(this);if(X.lo=(X.lo|(this.buf[this.pos]&127)<<Y*7)>>>0,this.buf[this.pos++]<128)return X}return X.lo=(X.lo|(this.buf[this.pos++]&127)<<Y*7)>>>0,X}if(this.len-this.pos>4){for(;Y<5;++Y)if(X.hi=(X.hi|(this.buf[this.pos]&127)<<Y*7+3)>>>0,this.buf[this.pos++]<128)return X}else for(;Y<5;++Y){if(this.pos>=this.len)throw O(this);if(X.hi=(X.hi|(this.buf[this.pos]&127)<<Y*7+3)>>>0,this.buf[this.pos++]<128)return X}throw Error("invalid varint encoding")}I.prototype.bool=function(){return this.uint32()!==0};function F(X,Y){return(X[Y-4]|X[Y-3]<<8|X[Y-2]<<16|X[Y-1]<<24)>>>0}I.prototype.fixed32=function(){if(this.pos+4>this.len)throw O(this,4);return F(this.buf,this.pos+=4)},I.prototype.sfixed32=function(){if(this.pos+4>this.len)throw O(this,4);return F(this.buf,this.pos+=4)|0};function J(){if(this.pos+8>this.len)throw O(this,8);return new D(F(this.buf,this.pos+=4),F(this.buf,this.pos+=4))}return I.prototype.float=function(){if(this.pos+4>this.len)throw O(this,4);var Y=$.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Y},I.prototype.double=function(){if(this.pos+8>this.len)throw O(this,4);var Y=$.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Y},I.prototype.bytes=function(){var Y=this.uint32(),Q=this.pos,te=this.pos+Y;if(te>this.len)throw O(this,Y);if(this.pos+=Y,Array.isArray(this.buf))return this.buf.slice(Q,te);if(Q===te){var ie=$.Buffer;return ie?ie.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Q,te)},I.prototype.string=function(){var Y=this.bytes();return j.read(Y,0,Y.length)},I.prototype.skip=function(Y){if(typeof Y=="number"){if(this.pos+Y>this.len)throw O(this,Y);this.pos+=Y}else do if(this.pos>=this.len)throw O(this);while(this.buf[this.pos++]&128);return this},I.prototype.skipType=function(X){switch(X){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(X=this.uint32()&7)!==4;)this.skipType(X);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+X+" at offset "+this.pos)}return this},I._configure=function(X){z=X,I.create=k(),z._configure();var Y=$.Long?"toLong":"toNumber";$.merge(I.prototype,{int64:function(){return N.call(this)[Y](!1)},uint64:function(){return N.call(this)[Y](!0)},sint64:function(){return N.call(this).zzDecode()[Y](!1)},fixed64:function(){return J.call(this)[Y](!0)},sfixed64:function(){return J.call(this)[Y](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=D;var $=requireReader();(D.prototype=Object.create($.prototype)).constructor=D;var z=requireMinimal$1();function D(j){$.call(this,j)}return D._configure=function(){z.Buffer&&(D.prototype._slice=z.Buffer.prototype.slice)},D.prototype.string=function(){var O=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+O,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+O,this.len))},D._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=z;var $=requireMinimal$1();(z.prototype=Object.create($.EventEmitter.prototype)).constructor=z;function z(D,j,O){if(typeof D!="function")throw TypeError("rpcImpl must be a function");$.EventEmitter.call(this),this.rpcImpl=D,this.requestDelimited=!!j,this.responseDelimited=!!O}return z.prototype.rpcCall=function D(j,O,I,o,k){if(!o)throw TypeError("request must be specified");var N=this;if(!k)return $.asPromise(D,N,j,O,I,o);if(!N.rpcImpl){setTimeout(function(){k(Error("already ended"))},0);return}try{return N.rpcImpl(j,O[N.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(J,X){if(J)return N.emit("error",J,j),k(J);if(X===null){N.end(!0);return}if(!(X instanceof I))try{X=I[N.responseDelimited?"decodeDelimited":"decode"](X)}catch(Y){return N.emit("error",Y,j),k(Y)}return N.emit("data",X,j),k(null,X)})}catch(F){N.emit("error",F,j),setTimeout(function(){k(F)},0);return}},z.prototype.end=function(j){return this.rpcImpl&&(j||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function($){var z=$;z.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function($){var z=$;z.build="minimal",z.Writer=requireWriter(),z.BufferWriter=requireWriter_buffer(),z.Reader=requireReader(),z.BufferReader=requireReader_buffer(),z.util=requireMinimal$1(),z.rpc=requireRpc(),z.roots=requireRoots(),z.configure=D;function D(){z.util._configure(),z.Writer._configure(z.BufferWriter),z.Reader._configure(z.BufferReader)}D()}(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const $={};return $.quick=function(){const z={};return z.voice=function(){const D={};return D.proto=function(){const j={};return j.CommonReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.version=0,O.prototype.compress=!1,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.event!=null&&Object.hasOwnProperty.call(o,"event")&&k.uint32(10).string(o.event),o.data!=null&&Object.hasOwnProperty.call(o,"data")&&k.uint32(18).bytes(o.data),o.sn!=null&&Object.hasOwnProperty.call(o,"sn")&&k.uint32(24).int64(o.sn),o.time!=null&&Object.hasOwnProperty.call(o,"time")&&k.uint32(32).int64(o.time),o.valid!=null&&Object.hasOwnProperty.call(o,"valid")&&k.uint32(40).int64(o.valid),o.version!=null&&Object.hasOwnProperty.call(o,"version")&&k.uint32(48).int32(o.version),o.compress!=null&&Object.hasOwnProperty.call(o,"compress")&&k.uint32(56).bool(o.compress),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.CommonReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.event=o.string();break}case 2:{F.data=o.bytes();break}case 3:{F.sn=o.int64();break}case 4:{F.time=o.int64();break}case 5:{F.valid=o.int64();break}case 6:{F.version=o.int32();break}case 7:{F.compress=o.bool();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.event!=null&&o.hasOwnProperty("event")&&!$util.isString(o.event)?"event: string expected":o.data!=null&&o.hasOwnProperty("data")&&!(o.data&&typeof o.data.length=="number"||$util.isString(o.data))?"data: buffer expected":o.sn!=null&&o.hasOwnProperty("sn")&&!$util.isInteger(o.sn)&&!(o.sn&&$util.isInteger(o.sn.low)&&$util.isInteger(o.sn.high))?"sn: integer|Long expected":o.time!=null&&o.hasOwnProperty("time")&&!$util.isInteger(o.time)&&!(o.time&&$util.isInteger(o.time.low)&&$util.isInteger(o.time.high))?"time: integer|Long expected":o.valid!=null&&o.hasOwnProperty("valid")&&!$util.isInteger(o.valid)&&!(o.valid&&$util.isInteger(o.valid.low)&&$util.isInteger(o.valid.high))?"valid: integer|Long expected":o.version!=null&&o.hasOwnProperty("version")&&!$util.isInteger(o.version)?"version: integer expected":o.compress!=null&&o.hasOwnProperty("compress")&&typeof o.compress!="boolean"?"compress: boolean expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CommonReq)return o;let k=new $root.com.quick.voice.proto.CommonReq;return o.event!=null&&(k.event=String(o.event)),o.data!=null&&(typeof o.data=="string"?$util.base64.decode(o.data,k.data=$util.newBuffer($util.base64.length(o.data)),0):o.data.length>=0&&(k.data=o.data)),o.sn!=null&&($util.Long?(k.sn=$util.Long.fromValue(o.sn)).unsigned=!1:typeof o.sn=="string"?k.sn=parseInt(o.sn,10):typeof o.sn=="number"?k.sn=o.sn:typeof o.sn=="object"&&(k.sn=new $util.LongBits(o.sn.low>>>0,o.sn.high>>>0).toNumber())),o.time!=null&&($util.Long?(k.time=$util.Long.fromValue(o.time)).unsigned=!1:typeof o.time=="string"?k.time=parseInt(o.time,10):typeof o.time=="number"?k.time=o.time:typeof o.time=="object"&&(k.time=new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber())),o.valid!=null&&($util.Long?(k.valid=$util.Long.fromValue(o.valid)).unsigned=!1:typeof o.valid=="string"?k.valid=parseInt(o.valid,10):typeof o.valid=="number"?k.valid=o.valid:typeof o.valid=="object"&&(k.valid=new $util.LongBits(o.valid.low>>>0,o.valid.high>>>0).toNumber())),o.version!=null&&(k.version=o.version|0),o.compress!=null&&(k.compress=!!o.compress),k},O.toObject=function(o,k){k||(k={});let N={};if(k.defaults){if(N.event="",k.bytes===String?N.data="":(N.data=[],k.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let F=new $util.Long(0,0,!1);N.sn=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.sn=k.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);N.time=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.time=k.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);N.valid=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.valid=k.longs===String?"0":0;N.version=0,N.compress=!1}return o.event!=null&&o.hasOwnProperty("event")&&(N.event=o.event),o.data!=null&&o.hasOwnProperty("data")&&(N.data=k.bytes===String?$util.base64.encode(o.data,0,o.data.length):k.bytes===Array?Array.prototype.slice.call(o.data):o.data),o.sn!=null&&o.hasOwnProperty("sn")&&(typeof o.sn=="number"?N.sn=k.longs===String?String(o.sn):o.sn:N.sn=k.longs===String?$util.Long.prototype.toString.call(o.sn):k.longs===Number?new $util.LongBits(o.sn.low>>>0,o.sn.high>>>0).toNumber():o.sn),o.time!=null&&o.hasOwnProperty("time")&&(typeof o.time=="number"?N.time=k.longs===String?String(o.time):o.time:N.time=k.longs===String?$util.Long.prototype.toString.call(o.time):k.longs===Number?new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber():o.time),o.valid!=null&&o.hasOwnProperty("valid")&&(typeof o.valid=="number"?N.valid=k.longs===String?String(o.valid):o.valid:N.valid=k.longs===String?$util.Long.prototype.toString.call(o.valid):k.longs===Number?new $util.LongBits(o.valid.low>>>0,o.valid.high>>>0).toNumber():o.valid),o.version!=null&&o.hasOwnProperty("version")&&(N.version=o.version),o.compress!=null&&o.hasOwnProperty("compress")&&(N.compress=o.compress),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CommonReq"},O}(),j.CommonRsp=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.code=0,O.prototype.desc="",O.prototype.version=0,O.prototype.compress=!1,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.event!=null&&Object.hasOwnProperty.call(o,"event")&&k.uint32(10).string(o.event),o.data!=null&&Object.hasOwnProperty.call(o,"data")&&k.uint32(18).bytes(o.data),o.sn!=null&&Object.hasOwnProperty.call(o,"sn")&&k.uint32(24).int64(o.sn),o.time!=null&&Object.hasOwnProperty.call(o,"time")&&k.uint32(32).int64(o.time),o.valid!=null&&Object.hasOwnProperty.call(o,"valid")&&k.uint32(40).int64(o.valid),o.code!=null&&Object.hasOwnProperty.call(o,"code")&&k.uint32(48).int32(o.code),o.desc!=null&&Object.hasOwnProperty.call(o,"desc")&&k.uint32(58).string(o.desc),o.version!=null&&Object.hasOwnProperty.call(o,"version")&&k.uint32(64).int32(o.version),o.compress!=null&&Object.hasOwnProperty.call(o,"compress")&&k.uint32(72).bool(o.compress),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.CommonRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.event=o.string();break}case 2:{F.data=o.bytes();break}case 3:{F.sn=o.int64();break}case 4:{F.time=o.int64();break}case 5:{F.valid=o.int64();break}case 6:{F.code=o.int32();break}case 7:{F.desc=o.string();break}case 8:{F.version=o.int32();break}case 9:{F.compress=o.bool();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.event!=null&&o.hasOwnProperty("event")&&!$util.isString(o.event)?"event: string expected":o.data!=null&&o.hasOwnProperty("data")&&!(o.data&&typeof o.data.length=="number"||$util.isString(o.data))?"data: buffer expected":o.sn!=null&&o.hasOwnProperty("sn")&&!$util.isInteger(o.sn)&&!(o.sn&&$util.isInteger(o.sn.low)&&$util.isInteger(o.sn.high))?"sn: integer|Long expected":o.time!=null&&o.hasOwnProperty("time")&&!$util.isInteger(o.time)&&!(o.time&&$util.isInteger(o.time.low)&&$util.isInteger(o.time.high))?"time: integer|Long expected":o.valid!=null&&o.hasOwnProperty("valid")&&!$util.isInteger(o.valid)&&!(o.valid&&$util.isInteger(o.valid.low)&&$util.isInteger(o.valid.high))?"valid: integer|Long expected":o.code!=null&&o.hasOwnProperty("code")&&!$util.isInteger(o.code)?"code: integer expected":o.desc!=null&&o.hasOwnProperty("desc")&&!$util.isString(o.desc)?"desc: string expected":o.version!=null&&o.hasOwnProperty("version")&&!$util.isInteger(o.version)?"version: integer expected":o.compress!=null&&o.hasOwnProperty("compress")&&typeof o.compress!="boolean"?"compress: boolean expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CommonRsp)return o;let k=new $root.com.quick.voice.proto.CommonRsp;return o.event!=null&&(k.event=String(o.event)),o.data!=null&&(typeof o.data=="string"?$util.base64.decode(o.data,k.data=$util.newBuffer($util.base64.length(o.data)),0):o.data.length>=0&&(k.data=o.data)),o.sn!=null&&($util.Long?(k.sn=$util.Long.fromValue(o.sn)).unsigned=!1:typeof o.sn=="string"?k.sn=parseInt(o.sn,10):typeof o.sn=="number"?k.sn=o.sn:typeof o.sn=="object"&&(k.sn=new $util.LongBits(o.sn.low>>>0,o.sn.high>>>0).toNumber())),o.time!=null&&($util.Long?(k.time=$util.Long.fromValue(o.time)).unsigned=!1:typeof o.time=="string"?k.time=parseInt(o.time,10):typeof o.time=="number"?k.time=o.time:typeof o.time=="object"&&(k.time=new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber())),o.valid!=null&&($util.Long?(k.valid=$util.Long.fromValue(o.valid)).unsigned=!1:typeof o.valid=="string"?k.valid=parseInt(o.valid,10):typeof o.valid=="number"?k.valid=o.valid:typeof o.valid=="object"&&(k.valid=new $util.LongBits(o.valid.low>>>0,o.valid.high>>>0).toNumber())),o.code!=null&&(k.code=o.code|0),o.desc!=null&&(k.desc=String(o.desc)),o.version!=null&&(k.version=o.version|0),o.compress!=null&&(k.compress=!!o.compress),k},O.toObject=function(o,k){k||(k={});let N={};if(k.defaults){if(N.event="",k.bytes===String?N.data="":(N.data=[],k.bytes!==Array&&(N.data=$util.newBuffer(N.data))),$util.Long){let F=new $util.Long(0,0,!1);N.sn=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.sn=k.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);N.time=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.time=k.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);N.valid=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.valid=k.longs===String?"0":0;N.code=0,N.desc="",N.version=0,N.compress=!1}return o.event!=null&&o.hasOwnProperty("event")&&(N.event=o.event),o.data!=null&&o.hasOwnProperty("data")&&(N.data=k.bytes===String?$util.base64.encode(o.data,0,o.data.length):k.bytes===Array?Array.prototype.slice.call(o.data):o.data),o.sn!=null&&o.hasOwnProperty("sn")&&(typeof o.sn=="number"?N.sn=k.longs===String?String(o.sn):o.sn:N.sn=k.longs===String?$util.Long.prototype.toString.call(o.sn):k.longs===Number?new $util.LongBits(o.sn.low>>>0,o.sn.high>>>0).toNumber():o.sn),o.time!=null&&o.hasOwnProperty("time")&&(typeof o.time=="number"?N.time=k.longs===String?String(o.time):o.time:N.time=k.longs===String?$util.Long.prototype.toString.call(o.time):k.longs===Number?new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber():o.time),o.valid!=null&&o.hasOwnProperty("valid")&&(typeof o.valid=="number"?N.valid=k.longs===String?String(o.valid):o.valid:N.valid=k.longs===String?$util.Long.prototype.toString.call(o.valid):k.longs===Number?new $util.LongBits(o.valid.low>>>0,o.valid.high>>>0).toNumber():o.valid),o.code!=null&&o.hasOwnProperty("code")&&(N.code=o.code),o.desc!=null&&o.hasOwnProperty("desc")&&(N.desc=o.desc),o.version!=null&&o.hasOwnProperty("version")&&(N.version=o.version),o.compress!=null&&o.hasOwnProperty("compress")&&(N.compress=o.compress),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CommonRsp"},O}(),j.User=function(){function O(o){if(this.tracks=[],o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.id="",O.prototype.callAction=null,O.prototype.callState=null,O.prototype.joinTime=null,O.prototype.tracks=$util.emptyArray,O.prototype.permissions=null,O.prototype.isPublished=null,O.prototype.behavior=null,O.prototype.channelCache=null;let I;return Object.defineProperty(O.prototype,"_callAction",{get:$util.oneOfGetter(I=["callAction"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_callState",{get:$util.oneOfGetter(I=["callState"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_joinTime",{get:$util.oneOfGetter(I=["joinTime"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_permissions",{get:$util.oneOfGetter(I=["permissions"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_isPublished",{get:$util.oneOfGetter(I=["isPublished"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_behavior",{get:$util.oneOfGetter(I=["behavior"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_channelCache",{get:$util.oneOfGetter(I=["channelCache"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){if(N||(N=$Writer.create()),k.id!=null&&Object.hasOwnProperty.call(k,"id")&&N.uint32(10).string(k.id),k.callAction!=null&&Object.hasOwnProperty.call(k,"callAction")&&N.uint32(16).int32(k.callAction),k.callState!=null&&Object.hasOwnProperty.call(k,"callState")&&N.uint32(24).int32(k.callState),k.joinTime!=null&&Object.hasOwnProperty.call(k,"joinTime")&&N.uint32(32).int64(k.joinTime),k.tracks!=null&&k.tracks.length)for(let F=0;F<k.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(k.tracks[F],N.uint32(42).fork()).ldelim();return k.permissions!=null&&Object.hasOwnProperty.call(k,"permissions")&&N.uint32(48).int32(k.permissions),k.isPublished!=null&&Object.hasOwnProperty.call(k,"isPublished")&&N.uint32(56).bool(k.isPublished),k.behavior!=null&&Object.hasOwnProperty.call(k,"behavior")&&N.uint32(64).int32(k.behavior),k.channelCache!=null&&Object.hasOwnProperty.call(k,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(k.channelCache,N.uint32(74).fork()).ldelim(),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.User;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.id=k.string();break}case 2:{J.callAction=k.int32();break}case 3:{J.callState=k.int32();break}case 4:{J.joinTime=k.int64();break}case 5:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(k,k.uint32()));break}case 6:{J.permissions=k.int32();break}case 7:{J.isPublished=k.bool();break}case 8:{J.behavior=k.int32();break}case 9:{J.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(k,k.uint32());break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.id!=null&&k.hasOwnProperty("id")&&!$util.isString(k.id))return"id: string expected";if(k.callAction!=null&&k.hasOwnProperty("callAction")&&!$util.isInteger(k.callAction))return"callAction: integer expected";if(k.callState!=null&&k.hasOwnProperty("callState")&&!$util.isInteger(k.callState))return"callState: integer expected";if(k.joinTime!=null&&k.hasOwnProperty("joinTime")&&!$util.isInteger(k.joinTime)&&!(k.joinTime&&$util.isInteger(k.joinTime.low)&&$util.isInteger(k.joinTime.high)))return"joinTime: integer|Long expected";if(k.tracks!=null&&k.hasOwnProperty("tracks")){if(!Array.isArray(k.tracks))return"tracks: array expected";for(let N=0;N<k.tracks.length;++N){let F=$root.com.quick.voice.proto.Track.verify(k.tracks[N]);if(F)return"tracks."+F}}if(k.permissions!=null&&k.hasOwnProperty("permissions")&&!$util.isInteger(k.permissions))return"permissions: integer expected";if(k.isPublished!=null&&k.hasOwnProperty("isPublished")&&typeof k.isPublished!="boolean")return"isPublished: boolean expected";if(k.behavior!=null&&k.hasOwnProperty("behavior")&&!$util.isInteger(k.behavior))return"behavior: integer expected";if(k.channelCache!=null&&k.hasOwnProperty("channelCache")){let N=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(k.channelCache);if(N)return"channelCache."+N}return null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.User)return k;let N=new $root.com.quick.voice.proto.User;if(k.id!=null&&(N.id=String(k.id)),k.callAction!=null&&(N.callAction=k.callAction|0),k.callState!=null&&(N.callState=k.callState|0),k.joinTime!=null&&($util.Long?(N.joinTime=$util.Long.fromValue(k.joinTime)).unsigned=!1:typeof k.joinTime=="string"?N.joinTime=parseInt(k.joinTime,10):typeof k.joinTime=="number"?N.joinTime=k.joinTime:typeof k.joinTime=="object"&&(N.joinTime=new $util.LongBits(k.joinTime.low>>>0,k.joinTime.high>>>0).toNumber())),k.tracks){if(!Array.isArray(k.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");N.tracks=[];for(let F=0;F<k.tracks.length;++F){if(typeof k.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");N.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(k.tracks[F])}}if(k.permissions!=null&&(N.permissions=k.permissions|0),k.isPublished!=null&&(N.isPublished=!!k.isPublished),k.behavior!=null&&(N.behavior=k.behavior|0),k.channelCache!=null){if(typeof k.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");N.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(k.channelCache)}return N},O.toObject=function(k,N){N||(N={});let F={};if((N.arrays||N.defaults)&&(F.tracks=[]),N.defaults&&(F.id=""),k.id!=null&&k.hasOwnProperty("id")&&(F.id=k.id),k.callAction!=null&&k.hasOwnProperty("callAction")&&(F.callAction=k.callAction,N.oneofs&&(F._callAction="callAction")),k.callState!=null&&k.hasOwnProperty("callState")&&(F.callState=k.callState,N.oneofs&&(F._callState="callState")),k.joinTime!=null&&k.hasOwnProperty("joinTime")&&(typeof k.joinTime=="number"?F.joinTime=N.longs===String?String(k.joinTime):k.joinTime:F.joinTime=N.longs===String?$util.Long.prototype.toString.call(k.joinTime):N.longs===Number?new $util.LongBits(k.joinTime.low>>>0,k.joinTime.high>>>0).toNumber():k.joinTime,N.oneofs&&(F._joinTime="joinTime")),k.tracks&&k.tracks.length){F.tracks=[];for(let J=0;J<k.tracks.length;++J)F.tracks[J]=$root.com.quick.voice.proto.Track.toObject(k.tracks[J],N)}return k.permissions!=null&&k.hasOwnProperty("permissions")&&(F.permissions=k.permissions,N.oneofs&&(F._permissions="permissions")),k.isPublished!=null&&k.hasOwnProperty("isPublished")&&(F.isPublished=k.isPublished,N.oneofs&&(F._isPublished="isPublished")),k.behavior!=null&&k.hasOwnProperty("behavior")&&(F.behavior=k.behavior,N.oneofs&&(F._behavior="behavior")),k.channelCache!=null&&k.hasOwnProperty("channelCache")&&(F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(k.channelCache,N),N.oneofs&&(F._channelCache="channelCache")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.User"},O}(),j.DataChannelCacheInfo=function(){function O(I){if(this.channels=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.channels=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.channels!=null&&o.channels.length)for(let N=0;N<o.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(o.channels[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.channels!=null&&o.hasOwnProperty("channels")){if(!Array.isArray(o.channels))return"channels: array expected";for(let k=0;k<o.channels.length;++k){let N=$root.com.quick.voice.proto.DataChannel.verify(o.channels[k]);if(N)return"channels."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return o;let k=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(o.channels){if(!Array.isArray(o.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");k.channels=[];for(let N=0;N<o.channels.length;++N){if(typeof o.channels[N]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");k.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(o.channels[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.channels=[]),o.channels&&o.channels.length){N.channels=[];for(let F=0;F<o.channels.length;++F)N.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(o.channels[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.DataChannelCacheInfo"},O}(),j.DataChannel=function(){function O(o){if(o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.dataChannelName="",O.prototype.id=null;let I;return Object.defineProperty(O.prototype,"_id",{get:$util.oneOfGetter(I=["id"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){return N||(N=$Writer.create()),k.dataChannelName!=null&&Object.hasOwnProperty.call(k,"dataChannelName")&&N.uint32(10).string(k.dataChannelName),k.id!=null&&Object.hasOwnProperty.call(k,"id")&&N.uint32(16).int32(k.id),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.DataChannel;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.dataChannelName=k.string();break}case 2:{J.id=k.int32();break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){return typeof k!="object"||k===null?"object expected":k.dataChannelName!=null&&k.hasOwnProperty("dataChannelName")&&!$util.isString(k.dataChannelName)?"dataChannelName: string expected":k.id!=null&&k.hasOwnProperty("id")&&!$util.isInteger(k.id)?"id: integer expected":null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.DataChannel)return k;let N=new $root.com.quick.voice.proto.DataChannel;return k.dataChannelName!=null&&(N.dataChannelName=String(k.dataChannelName)),k.id!=null&&(N.id=k.id|0),N},O.toObject=function(k,N){N||(N={});let F={};return N.defaults&&(F.dataChannelName=""),k.dataChannelName!=null&&k.hasOwnProperty("dataChannelName")&&(F.dataChannelName=k.dataChannelName),k.id!=null&&k.hasOwnProperty("id")&&(F.id=k.id,N.oneofs&&(F._id="id")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.DataChannel"},O}(),j.Login=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.appid="",O.prototype.userId="",O.prototype.sdkToken="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.appid!=null&&Object.hasOwnProperty.call(o,"appid")&&k.uint32(10).string(o.appid),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(18).string(o.userId),o.sdkToken!=null&&Object.hasOwnProperty.call(o,"sdkToken")&&k.uint32(26).string(o.sdkToken),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.Login;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.appid=o.string();break}case 2:{F.userId=o.string();break}case 3:{F.sdkToken=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.appid!=null&&o.hasOwnProperty("appid")&&!$util.isString(o.appid)?"appid: string expected":o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId)?"userId: string expected":o.sdkToken!=null&&o.hasOwnProperty("sdkToken")&&!$util.isString(o.sdkToken)?"sdkToken: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.Login)return o;let k=new $root.com.quick.voice.proto.Login;return o.appid!=null&&(k.appid=String(o.appid)),o.userId!=null&&(k.userId=String(o.userId)),o.sdkToken!=null&&(k.sdkToken=String(o.sdkToken)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.appid="",N.userId="",N.sdkToken=""),o.appid!=null&&o.hasOwnProperty("appid")&&(N.appid=o.appid),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.sdkToken!=null&&o.hasOwnProperty("sdkToken")&&(N.sdkToken=o.sdkToken),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.Login"},O}(),j.Track=function(){function O(o){if(o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.mid="",O.prototype.trackName=null,O.prototype.location=null,O.prototype.userId=null,O.prototype.code=null,O.prototype.desc=null,O.prototype.type=null,O.prototype.isValid=null,O.prototype.simulcast=null;let I;return Object.defineProperty(O.prototype,"_trackName",{get:$util.oneOfGetter(I=["trackName"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_location",{get:$util.oneOfGetter(I=["location"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_userId",{get:$util.oneOfGetter(I=["userId"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_type",{get:$util.oneOfGetter(I=["type"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_isValid",{get:$util.oneOfGetter(I=["isValid"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_simulcast",{get:$util.oneOfGetter(I=["simulcast"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){return N||(N=$Writer.create()),k.mid!=null&&Object.hasOwnProperty.call(k,"mid")&&N.uint32(10).string(k.mid),k.trackName!=null&&Object.hasOwnProperty.call(k,"trackName")&&N.uint32(18).string(k.trackName),k.location!=null&&Object.hasOwnProperty.call(k,"location")&&N.uint32(26).string(k.location),k.userId!=null&&Object.hasOwnProperty.call(k,"userId")&&N.uint32(34).string(k.userId),k.code!=null&&Object.hasOwnProperty.call(k,"code")&&N.uint32(40).int32(k.code),k.desc!=null&&Object.hasOwnProperty.call(k,"desc")&&N.uint32(50).string(k.desc),k.type!=null&&Object.hasOwnProperty.call(k,"type")&&N.uint32(56).int32(k.type),k.isValid!=null&&Object.hasOwnProperty.call(k,"isValid")&&N.uint32(64).bool(k.isValid),k.simulcast!=null&&Object.hasOwnProperty.call(k,"simulcast")&&N.uint32(74).string(k.simulcast),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.Track;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.mid=k.string();break}case 2:{J.trackName=k.string();break}case 3:{J.location=k.string();break}case 4:{J.userId=k.string();break}case 5:{J.code=k.int32();break}case 6:{J.desc=k.string();break}case 7:{J.type=k.int32();break}case 8:{J.isValid=k.bool();break}case 9:{J.simulcast=k.string();break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.mid!=null&&k.hasOwnProperty("mid")&&!$util.isString(k.mid))return"mid: string expected";if(k.trackName!=null&&k.hasOwnProperty("trackName")&&!$util.isString(k.trackName))return"trackName: string expected";if(k.location!=null&&k.hasOwnProperty("location")&&!$util.isString(k.location))return"location: string expected";if(k.userId!=null&&k.hasOwnProperty("userId")&&!$util.isString(k.userId))return"userId: string expected";if(k.code!=null&&k.hasOwnProperty("code")&&!$util.isInteger(k.code))return"code: integer expected";if(k.desc!=null&&k.hasOwnProperty("desc")&&!$util.isString(k.desc))return"desc: string expected";if(k.type!=null&&k.hasOwnProperty("type"))switch(k.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return k.isValid!=null&&k.hasOwnProperty("isValid")&&typeof k.isValid!="boolean"?"isValid: boolean expected":k.simulcast!=null&&k.hasOwnProperty("simulcast")&&!$util.isString(k.simulcast)?"simulcast: string expected":null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.Track)return k;let N=new $root.com.quick.voice.proto.Track;switch(k.mid!=null&&(N.mid=String(k.mid)),k.trackName!=null&&(N.trackName=String(k.trackName)),k.location!=null&&(N.location=String(k.location)),k.userId!=null&&(N.userId=String(k.userId)),k.code!=null&&(N.code=k.code|0),k.desc!=null&&(N.desc=String(k.desc)),k.type){default:if(typeof k.type=="number"){N.type=k.type;break}break;case"Microphone":case 0:N.type=0;break;case"Camera":case 1:N.type=1;break;case"Screen":case 2:N.type=2;break;case"SystemVoice":case 3:N.type=3;break}return k.isValid!=null&&(N.isValid=!!k.isValid),k.simulcast!=null&&(N.simulcast=String(k.simulcast)),N},O.toObject=function(k,N){N||(N={});let F={};return N.defaults&&(F.mid=""),k.mid!=null&&k.hasOwnProperty("mid")&&(F.mid=k.mid),k.trackName!=null&&k.hasOwnProperty("trackName")&&(F.trackName=k.trackName,N.oneofs&&(F._trackName="trackName")),k.location!=null&&k.hasOwnProperty("location")&&(F.location=k.location,N.oneofs&&(F._location="location")),k.userId!=null&&k.hasOwnProperty("userId")&&(F.userId=k.userId,N.oneofs&&(F._userId="userId")),k.code!=null&&k.hasOwnProperty("code")&&(F.code=k.code,N.oneofs&&(F._code="code")),k.desc!=null&&k.hasOwnProperty("desc")&&(F.desc=k.desc,N.oneofs&&(F._desc="desc")),k.type!=null&&k.hasOwnProperty("type")&&(F.type=N.enums===String?$root.com.quick.voice.proto.TrackType[k.type]===void 0?k.type:$root.com.quick.voice.proto.TrackType[k.type]:k.type,N.oneofs&&(F._type="type")),k.isValid!=null&&k.hasOwnProperty("isValid")&&(F.isValid=k.isValid,N.oneofs&&(F._isValid="isValid")),k.simulcast!=null&&k.hasOwnProperty("simulcast")&&(F.simulcast=k.simulcast,N.oneofs&&(F._simulcast="simulcast")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.Track"},O}(),j.JoinReq=function(){function O(o){if(o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.callType=0,O.prototype.token=null;let I;return Object.defineProperty(O.prototype,"_token",{get:$util.oneOfGetter(I=["token"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){return N||(N=$Writer.create()),k.roomId!=null&&Object.hasOwnProperty.call(k,"roomId")&&N.uint32(10).string(k.roomId),k.user!=null&&Object.hasOwnProperty.call(k,"user")&&$root.com.quick.voice.proto.User.encode(k.user,N.uint32(18).fork()).ldelim(),k.callType!=null&&Object.hasOwnProperty.call(k,"callType")&&N.uint32(24).int32(k.callType),k.token!=null&&Object.hasOwnProperty.call(k,"token")&&N.uint32(34).string(k.token),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.JoinReq;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.roomId=k.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(k,k.uint32());break}case 3:{J.callType=k.int32();break}case 4:{J.token=k.string();break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.roomId!=null&&k.hasOwnProperty("roomId")&&!$util.isString(k.roomId))return"roomId: string expected";if(k.user!=null&&k.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(k.user);if(N)return"user."+N}if(k.callType!=null&&k.hasOwnProperty("callType"))switch(k.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return k.token!=null&&k.hasOwnProperty("token")&&!$util.isString(k.token)?"token: string expected":null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.JoinReq)return k;let N=new $root.com.quick.voice.proto.JoinReq;if(k.roomId!=null&&(N.roomId=String(k.roomId)),k.user!=null){if(typeof k.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(k.user)}switch(k.callType){default:if(typeof k.callType=="number"){N.callType=k.callType;break}break;case"Normal":case 0:N.callType=0;break;case"Meeting":case 1:N.callType=1;break;case"Live":case 2:N.callType=2;break}return k.token!=null&&(N.token=String(k.token)),N},O.toObject=function(k,N){N||(N={});let F={};return N.defaults&&(F.roomId="",F.user=null,F.callType=N.enums===String?"Normal":0),k.roomId!=null&&k.hasOwnProperty("roomId")&&(F.roomId=k.roomId),k.user!=null&&k.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(k.user,N)),k.callType!=null&&k.hasOwnProperty("callType")&&(F.callType=N.enums===String?$root.com.quick.voice.proto.CallType[k.callType]===void 0?k.callType:$root.com.quick.voice.proto.CallType[k.callType]:k.callType),k.token!=null&&k.hasOwnProperty("token")&&(F.token=k.token,N.oneofs&&(F._token="token")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.JoinReq"},O}(),j.JoinRsp=function(){function O(I){if(this.roomUsers=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.roomUsers=$util.emptyArray,O.prototype.callType=0,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.roomUsers!=null&&o.roomUsers.length)for(let N=0;N<o.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(o.roomUsers[N],k.uint32(18).fork()).ldelim();return o.callType!=null&&Object.hasOwnProperty.call(o,"callType")&&k.uint32(24).int32(o.callType),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.JoinRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}case 3:{F.callType=o.int32();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.roomUsers!=null&&o.hasOwnProperty("roomUsers")){if(!Array.isArray(o.roomUsers))return"roomUsers: array expected";for(let k=0;k<o.roomUsers.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.roomUsers[k]);if(N)return"roomUsers."+N}}if(o.callType!=null&&o.hasOwnProperty("callType"))switch(o.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.JoinRsp)return o;let k=new $root.com.quick.voice.proto.JoinRsp;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.roomUsers){if(!Array.isArray(o.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");k.roomUsers=[];for(let N=0;N<o.roomUsers.length;++N){if(typeof o.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");k.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(o.roomUsers[N])}}switch(o.callType){default:if(typeof o.callType=="number"){k.callType=o.callType;break}break;case"Normal":case 0:k.callType=0;break;case"Meeting":case 1:k.callType=1;break;case"Live":case 2:k.callType=2;break}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.roomUsers=[]),k.defaults&&(N.roomId="",N.callType=k.enums===String?"Normal":0),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.roomUsers&&o.roomUsers.length){N.roomUsers=[];for(let F=0;F<o.roomUsers.length;++F)N.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(o.roomUsers[F],k)}return o.callType!=null&&o.hasOwnProperty("callType")&&(N.callType=k.enums===String?$root.com.quick.voice.proto.CallType[o.callType]===void 0?o.callType:$root.com.quick.voice.proto.CallType[o.callType]:o.callType),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.JoinRsp"},O}(),j.JoinNotify=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(18).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.JoinNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.JoinNotify)return o;let k=new $root.com.quick.voice.proto.JoinNotify;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.JoinNotify"},O}(),j.ConnectCFReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.sdp="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.sdp!=null&&Object.hasOwnProperty.call(o,"sdp")&&k.uint32(10).string(o.sdp),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ConnectCFReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.sdp=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.sdp!=null&&o.hasOwnProperty("sdp")&&!$util.isString(o.sdp)?"sdp: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ConnectCFReq)return o;let k=new $root.com.quick.voice.proto.ConnectCFReq;return o.sdp!=null&&(k.sdp=String(o.sdp)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.sdp=""),o.sdp!=null&&o.hasOwnProperty("sdp")&&(N.sdp=o.sdp),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ConnectCFReq"},O}(),j.ConnectCFRsp=function(){function O(I){if(this.subscribeUsers=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.remoteSdp="",O.prototype.subscribeUsers=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.remoteSdp!=null&&Object.hasOwnProperty.call(o,"remoteSdp")&&k.uint32(10).string(o.remoteSdp),o.subscribeUsers!=null&&o.subscribeUsers.length)for(let N=0;N<o.subscribeUsers.length;++N)$root.com.quick.voice.proto.User.encode(o.subscribeUsers[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ConnectCFRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.remoteSdp=o.string();break}case 2:{F.subscribeUsers&&F.subscribeUsers.length||(F.subscribeUsers=[]),F.subscribeUsers.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&!$util.isString(o.remoteSdp))return"remoteSdp: string expected";if(o.subscribeUsers!=null&&o.hasOwnProperty("subscribeUsers")){if(!Array.isArray(o.subscribeUsers))return"subscribeUsers: array expected";for(let k=0;k<o.subscribeUsers.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.subscribeUsers[k]);if(N)return"subscribeUsers."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ConnectCFRsp)return o;let k=new $root.com.quick.voice.proto.ConnectCFRsp;if(o.remoteSdp!=null&&(k.remoteSdp=String(o.remoteSdp)),o.subscribeUsers){if(!Array.isArray(o.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");k.subscribeUsers=[];for(let N=0;N<o.subscribeUsers.length;++N){if(typeof o.subscribeUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");k.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(o.subscribeUsers[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.subscribeUsers=[]),k.defaults&&(N.remoteSdp=""),o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&(N.remoteSdp=o.remoteSdp),o.subscribeUsers&&o.subscribeUsers.length){N.subscribeUsers=[];for(let F=0;F<o.subscribeUsers.length;++F)N.subscribeUsers[F]=$root.com.quick.voice.proto.User.toObject(o.subscribeUsers[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ConnectCFRsp"},O}(),j.PublishReq=function(){function O(o){if(this.tracks=[],o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.callAction=0,O.prototype.recreate=null;let I;return Object.defineProperty(O.prototype,"_recreate",{get:$util.oneOfGetter(I=["recreate"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){if(N||(N=$Writer.create()),k.sdp!=null&&Object.hasOwnProperty.call(k,"sdp")&&N.uint32(10).string(k.sdp),k.tracks!=null&&k.tracks.length)for(let F=0;F<k.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(k.tracks[F],N.uint32(18).fork()).ldelim();return k.callAction!=null&&Object.hasOwnProperty.call(k,"callAction")&&N.uint32(24).int32(k.callAction),k.recreate!=null&&Object.hasOwnProperty.call(k,"recreate")&&N.uint32(32).bool(k.recreate),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.PublishReq;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.sdp=k.string();break}case 2:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(k,k.uint32()));break}case 3:{J.callAction=k.int32();break}case 4:{J.recreate=k.bool();break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.sdp!=null&&k.hasOwnProperty("sdp")&&!$util.isString(k.sdp))return"sdp: string expected";if(k.tracks!=null&&k.hasOwnProperty("tracks")){if(!Array.isArray(k.tracks))return"tracks: array expected";for(let N=0;N<k.tracks.length;++N){let F=$root.com.quick.voice.proto.Track.verify(k.tracks[N]);if(F)return"tracks."+F}}return k.callAction!=null&&k.hasOwnProperty("callAction")&&!$util.isInteger(k.callAction)?"callAction: integer expected":k.recreate!=null&&k.hasOwnProperty("recreate")&&typeof k.recreate!="boolean"?"recreate: boolean expected":null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.PublishReq)return k;let N=new $root.com.quick.voice.proto.PublishReq;if(k.sdp!=null&&(N.sdp=String(k.sdp)),k.tracks){if(!Array.isArray(k.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");N.tracks=[];for(let F=0;F<k.tracks.length;++F){if(typeof k.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");N.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(k.tracks[F])}}return k.callAction!=null&&(N.callAction=k.callAction|0),k.recreate!=null&&(N.recreate=!!k.recreate),N},O.toObject=function(k,N){N||(N={});let F={};if((N.arrays||N.defaults)&&(F.tracks=[]),N.defaults&&(F.sdp="",F.callAction=0),k.sdp!=null&&k.hasOwnProperty("sdp")&&(F.sdp=k.sdp),k.tracks&&k.tracks.length){F.tracks=[];for(let J=0;J<k.tracks.length;++J)F.tracks[J]=$root.com.quick.voice.proto.Track.toObject(k.tracks[J],N)}return k.callAction!=null&&k.hasOwnProperty("callAction")&&(F.callAction=k.callAction),k.recreate!=null&&k.hasOwnProperty("recreate")&&(F.recreate=k.recreate,N.oneofs&&(F._recreate="recreate")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.PublishReq"},O}(),j.PublishRsp=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.remoteSdp="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.remoteSdp!=null&&Object.hasOwnProperty.call(o,"remoteSdp")&&k.uint32(10).string(o.remoteSdp),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.PublishRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.remoteSdp=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&!$util.isString(o.remoteSdp)?"remoteSdp: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PublishRsp)return o;let k=new $root.com.quick.voice.proto.PublishRsp;return o.remoteSdp!=null&&(k.remoteSdp=String(o.remoteSdp)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.remoteSdp=""),o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&(N.remoteSdp=o.remoteSdp),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PublishRsp"},O}(),j.PublishNotify=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(18).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.PublishNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PublishNotify)return o;let k=new $root.com.quick.voice.proto.PublishNotify;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PublishNotify"},O}(),j.SubscribeReq=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.users=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.User.encode(o.users[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.SubscribeReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.users[k]);if(N)return"users."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.SubscribeReq)return o;let k=new $root.com.quick.voice.proto.SubscribeReq;if(o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");k.users[N]=$root.com.quick.voice.proto.User.fromObject(o.users[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(o.users[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.SubscribeReq"},O}(),j.SubscribeRsp=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.remoteSdp="",O.prototype.users=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.remoteSdp!=null&&Object.hasOwnProperty.call(o,"remoteSdp")&&k.uint32(10).string(o.remoteSdp),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.User.encode(o.users[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.SubscribeRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.remoteSdp=o.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&!$util.isString(o.remoteSdp))return"remoteSdp: string expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.users[k]);if(N)return"users."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.SubscribeRsp)return o;let k=new $root.com.quick.voice.proto.SubscribeRsp;if(o.remoteSdp!=null&&(k.remoteSdp=String(o.remoteSdp)),o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");k.users[N]=$root.com.quick.voice.proto.User.fromObject(o.users[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),k.defaults&&(N.remoteSdp=""),o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&(N.remoteSdp=o.remoteSdp),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(o.users[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.SubscribeRsp"},O}(),j.RenegotiateReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.userId="",O.prototype.sdp="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(10).string(o.userId),o.sdp!=null&&Object.hasOwnProperty.call(o,"sdp")&&k.uint32(18).string(o.sdp),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.RenegotiateReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.userId=o.string();break}case 2:{F.sdp=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId)?"userId: string expected":o.sdp!=null&&o.hasOwnProperty("sdp")&&!$util.isString(o.sdp)?"sdp: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.RenegotiateReq)return o;let k=new $root.com.quick.voice.proto.RenegotiateReq;return o.userId!=null&&(k.userId=String(o.userId)),o.sdp!=null&&(k.sdp=String(o.sdp)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.userId="",N.sdp=""),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.sdp!=null&&o.hasOwnProperty("sdp")&&(N.sdp=o.sdp),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.RenegotiateReq"},O}(),j.QuitReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.userId="",O.prototype.roomId="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(10).string(o.userId),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(18).string(o.roomId),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.QuitReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.userId=o.string();break}case 2:{F.roomId=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId)?"userId: string expected":o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.QuitReq)return o;let k=new $root.com.quick.voice.proto.QuitReq;return o.userId!=null&&(k.userId=String(o.userId)),o.roomId!=null&&(k.roomId=String(o.roomId)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.userId="",N.roomId=""),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.QuitReq"},O}(),j.QuitNotify=function(){function O(o){if(o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.code=null,O.prototype.desc=null;let I;return Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(I=["code"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(I=["desc"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){return N||(N=$Writer.create()),k.roomId!=null&&Object.hasOwnProperty.call(k,"roomId")&&N.uint32(10).string(k.roomId),k.user!=null&&Object.hasOwnProperty.call(k,"user")&&$root.com.quick.voice.proto.User.encode(k.user,N.uint32(18).fork()).ldelim(),k.code!=null&&Object.hasOwnProperty.call(k,"code")&&N.uint32(24).int32(k.code),k.desc!=null&&Object.hasOwnProperty.call(k,"desc")&&N.uint32(34).string(k.desc),N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.QuitNotify;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.roomId=k.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(k,k.uint32());break}case 3:{J.code=k.int32();break}case 4:{J.desc=k.string();break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.roomId!=null&&k.hasOwnProperty("roomId")&&!$util.isString(k.roomId))return"roomId: string expected";if(k.user!=null&&k.hasOwnProperty("user")){let N=$root.com.quick.voice.proto.User.verify(k.user);if(N)return"user."+N}return k.code!=null&&k.hasOwnProperty("code")&&!$util.isInteger(k.code)?"code: integer expected":k.desc!=null&&k.hasOwnProperty("desc")&&!$util.isString(k.desc)?"desc: string expected":null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.QuitNotify)return k;let N=new $root.com.quick.voice.proto.QuitNotify;if(k.roomId!=null&&(N.roomId=String(k.roomId)),k.user!=null){if(typeof k.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");N.user=$root.com.quick.voice.proto.User.fromObject(k.user)}return k.code!=null&&(N.code=k.code|0),k.desc!=null&&(N.desc=String(k.desc)),N},O.toObject=function(k,N){N||(N={});let F={};return N.defaults&&(F.roomId="",F.user=null),k.roomId!=null&&k.hasOwnProperty("roomId")&&(F.roomId=k.roomId),k.user!=null&&k.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(k.user,N)),k.code!=null&&k.hasOwnProperty("code")&&(F.code=k.code,N.oneofs&&(F._code="code")),k.desc!=null&&k.hasOwnProperty("desc")&&(F.desc=k.desc,N.oneofs&&(F._desc="desc")),F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.QuitNotify"},O}(),j.TokenExpireNotify=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.TokenExpireNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.TokenExpireNotify)return o;let k=new $root.com.quick.voice.proto.TokenExpireNotify;return o.roomId!=null&&(k.roomId=String(o.roomId)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.TokenExpireNotify"},O}(),j.UpdateTokenReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.sdkToken="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.sdkToken!=null&&Object.hasOwnProperty.call(o,"sdkToken")&&k.uint32(18).string(o.sdkToken),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UpdateTokenReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.sdkToken=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":o.sdkToken!=null&&o.hasOwnProperty("sdkToken")&&!$util.isString(o.sdkToken)?"sdkToken: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UpdateTokenReq)return o;let k=new $root.com.quick.voice.proto.UpdateTokenReq;return o.roomId!=null&&(k.roomId=String(o.roomId)),o.sdkToken!=null&&(k.sdkToken=String(o.sdkToken)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.sdkToken=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.sdkToken!=null&&o.hasOwnProperty("sdkToken")&&(N.sdkToken=o.sdkToken),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UpdateTokenReq"},O}(),j.NetQualityChange=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.userId="",O.prototype.roomId="",O.prototype.egress=0,O.prototype.ingress=0,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(10).string(o.userId),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(18).string(o.roomId),o.egress!=null&&Object.hasOwnProperty.call(o,"egress")&&k.uint32(24).int32(o.egress),o.ingress!=null&&Object.hasOwnProperty.call(o,"ingress")&&k.uint32(32).int32(o.ingress),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.NetQualityChange;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.userId=o.string();break}case 2:{F.roomId=o.string();break}case 3:{F.egress=o.int32();break}case 4:{F.ingress=o.int32();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId)?"userId: string expected":o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":o.egress!=null&&o.hasOwnProperty("egress")&&!$util.isInteger(o.egress)?"egress: integer expected":o.ingress!=null&&o.hasOwnProperty("ingress")&&!$util.isInteger(o.ingress)?"ingress: integer expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.NetQualityChange)return o;let k=new $root.com.quick.voice.proto.NetQualityChange;return o.userId!=null&&(k.userId=String(o.userId)),o.roomId!=null&&(k.roomId=String(o.roomId)),o.egress!=null&&(k.egress=o.egress|0),o.ingress!=null&&(k.ingress=o.ingress|0),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.userId="",N.roomId="",N.egress=0,N.ingress=0),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.egress!=null&&o.hasOwnProperty("egress")&&(N.egress=o.egress),o.ingress!=null&&o.hasOwnProperty("ingress")&&(N.ingress=o.ingress),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.NetQualityChange"},O}(),j.NetQualityNotify=function(){function O(I){if(this.qualities=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.qualities=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.qualities!=null&&o.qualities.length)for(let N=0;N<o.qualities.length;++N)$root.com.quick.voice.proto.NetQualityChange.encode(o.qualities[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.NetQualityNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.qualities&&F.qualities.length||(F.qualities=[]),F.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.qualities!=null&&o.hasOwnProperty("qualities")){if(!Array.isArray(o.qualities))return"qualities: array expected";for(let k=0;k<o.qualities.length;++k){let N=$root.com.quick.voice.proto.NetQualityChange.verify(o.qualities[k]);if(N)return"qualities."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.NetQualityNotify)return o;let k=new $root.com.quick.voice.proto.NetQualityNotify;if(o.qualities){if(!Array.isArray(o.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");k.qualities=[];for(let N=0;N<o.qualities.length;++N){if(typeof o.qualities[N]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");k.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.fromObject(o.qualities[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.qualities=[]),o.qualities&&o.qualities.length){N.qualities=[];for(let F=0;F<o.qualities.length;++F)N.qualities[F]=$root.com.quick.voice.proto.NetQualityChange.toObject(o.qualities[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.NetQualityNotify"},O}(),j.UpdateCall=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(18).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UpdateCall;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UpdateCall)return o;let k=new $root.com.quick.voice.proto.UpdateCall;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UpdateCall"},O}(),j.SyncRoomInfoReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(18).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return o;let k=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.SyncRoomInfoReq"},O}(),j.SyncRoomInfoRsp=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.isValid=!1,O.prototype.users=$util.emptyArray,O.prototype.isActive=!1,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.isValid!=null&&Object.hasOwnProperty.call(o,"isValid")&&k.uint32(16).bool(o.isValid),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.User.encode(o.users[N],k.uint32(26).fork()).ldelim();return o.isActive!=null&&Object.hasOwnProperty.call(o,"isActive")&&k.uint32(32).bool(o.isActive),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.isValid=o.bool();break}case 3:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}case 4:{F.isActive=o.bool();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.isValid!=null&&o.hasOwnProperty("isValid")&&typeof o.isValid!="boolean")return"isValid: boolean expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.users[k]);if(N)return"users."+N}}return o.isActive!=null&&o.hasOwnProperty("isActive")&&typeof o.isActive!="boolean"?"isActive: boolean expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return o;let k=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.isValid!=null&&(k.isValid=!!o.isValid),o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");k.users[N]=$root.com.quick.voice.proto.User.fromObject(o.users[N])}}return o.isActive!=null&&(k.isActive=!!o.isActive),k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),k.defaults&&(N.roomId="",N.isValid=!1,N.isActive=!1),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.isValid!=null&&o.hasOwnProperty("isValid")&&(N.isValid=o.isValid),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(o.users[F],k)}return o.isActive!=null&&o.hasOwnProperty("isActive")&&(N.isActive=o.isActive),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.SyncRoomInfoRsp"},O}(),j.UpdateTime=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.time!=null&&Object.hasOwnProperty.call(o,"time")&&k.uint32(8).int64(o.time),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UpdateTime;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.time=o.int64();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.time!=null&&o.hasOwnProperty("time")&&!$util.isInteger(o.time)&&!(o.time&&$util.isInteger(o.time.low)&&$util.isInteger(o.time.high))?"time: integer|Long expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UpdateTime)return o;let k=new $root.com.quick.voice.proto.UpdateTime;return o.time!=null&&($util.Long?(k.time=$util.Long.fromValue(o.time)).unsigned=!1:typeof o.time=="string"?k.time=parseInt(o.time,10):typeof o.time=="number"?k.time=o.time:typeof o.time=="object"&&(k.time=new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber())),k},O.toObject=function(o,k){k||(k={});let N={};if(k.defaults)if($util.Long){let F=new $util.Long(0,0,!1);N.time=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.time=k.longs===String?"0":0;return o.time!=null&&o.hasOwnProperty("time")&&(typeof o.time=="number"?N.time=k.longs===String?String(o.time):o.time:N.time=k.longs===String?$util.Long.prototype.toString.call(o.time):k.longs===Number?new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber():o.time),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UpdateTime"},O}(),j.CloseTrackReq=function(){function O(I){if(this.tracks=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.roomId="",O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.sdp!=null&&Object.hasOwnProperty.call(o,"sdp")&&k.uint32(10).string(o.sdp),o.tracks!=null&&o.tracks.length)for(let N=0;N<o.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(o.tracks[N],k.uint32(18).fork()).ldelim();return o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(26).string(o.roomId),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.CloseTrackReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.sdp=o.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(o,o.uint32()));break}case 3:{F.roomId=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.sdp!=null&&o.hasOwnProperty("sdp")&&!$util.isString(o.sdp))return"sdp: string expected";if(o.tracks!=null&&o.hasOwnProperty("tracks")){if(!Array.isArray(o.tracks))return"tracks: array expected";for(let k=0;k<o.tracks.length;++k){let N=$root.com.quick.voice.proto.Track.verify(o.tracks[k]);if(N)return"tracks."+N}}return o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CloseTrackReq)return o;let k=new $root.com.quick.voice.proto.CloseTrackReq;if(o.sdp!=null&&(k.sdp=String(o.sdp)),o.tracks){if(!Array.isArray(o.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");k.tracks=[];for(let N=0;N<o.tracks.length;++N){if(typeof o.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");k.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(o.tracks[N])}}return o.roomId!=null&&(k.roomId=String(o.roomId)),k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.tracks=[]),k.defaults&&(N.sdp="",N.roomId=""),o.sdp!=null&&o.hasOwnProperty("sdp")&&(N.sdp=o.sdp),o.tracks&&o.tracks.length){N.tracks=[];for(let F=0;F<o.tracks.length;++F)N.tracks[F]=$root.com.quick.voice.proto.Track.toObject(o.tracks[F],k)}return o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CloseTrackReq"},O}(),j.CloseTrackRsp=function(){function O(I){if(this.tracks=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.remoteSdp="",O.prototype.tracks=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.remoteSdp!=null&&Object.hasOwnProperty.call(o,"remoteSdp")&&k.uint32(10).string(o.remoteSdp),o.tracks!=null&&o.tracks.length)for(let N=0;N<o.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(o.tracks[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.CloseTrackRsp;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.remoteSdp=o.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&!$util.isString(o.remoteSdp))return"remoteSdp: string expected";if(o.tracks!=null&&o.hasOwnProperty("tracks")){if(!Array.isArray(o.tracks))return"tracks: array expected";for(let k=0;k<o.tracks.length;++k){let N=$root.com.quick.voice.proto.Track.verify(o.tracks[k]);if(N)return"tracks."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CloseTrackRsp)return o;let k=new $root.com.quick.voice.proto.CloseTrackRsp;if(o.remoteSdp!=null&&(k.remoteSdp=String(o.remoteSdp)),o.tracks){if(!Array.isArray(o.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");k.tracks=[];for(let N=0;N<o.tracks.length;++N){if(typeof o.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");k.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(o.tracks[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.tracks=[]),k.defaults&&(N.remoteSdp=""),o.remoteSdp!=null&&o.hasOwnProperty("remoteSdp")&&(N.remoteSdp=o.remoteSdp),o.tracks&&o.tracks.length){N.tracks=[];for(let F=0;F<o.tracks.length;++F)N.tracks[F]=$root.com.quick.voice.proto.Track.toObject(o.tracks[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CloseTrackRsp"},O}(),j.CloseTrackNotify=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(10).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.CloseTrackNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.CloseTrackNotify)return o;let k=new $root.com.quick.voice.proto.CloseTrackNotify;if(o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.user=null),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.CloseTrackNotify"},O}(),j.ToggleLiveRoomReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId)?"roomId: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return o;let k=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return o.roomId!=null&&(k.roomId=String(o.roomId)),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ToggleLiveRoomReq"},O}(),j.ToggleLiveRoomRsq=function(){function O(I){if(this.roomUsers=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.hash="",O.prototype.roomUsers=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.hash!=null&&Object.hasOwnProperty.call(o,"hash")&&k.uint32(18).string(o.hash),o.roomUsers!=null&&o.roomUsers.length)for(let N=0;N<o.roomUsers.length;++N)$root.com.quick.voice.proto.User.encode(o.roomUsers[N],k.uint32(26).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.hash=o.string();break}case 3:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.hash!=null&&o.hasOwnProperty("hash")&&!$util.isString(o.hash))return"hash: string expected";if(o.roomUsers!=null&&o.hasOwnProperty("roomUsers")){if(!Array.isArray(o.roomUsers))return"roomUsers: array expected";for(let k=0;k<o.roomUsers.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.roomUsers[k]);if(N)return"roomUsers."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return o;let k=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.hash!=null&&(k.hash=String(o.hash)),o.roomUsers){if(!Array.isArray(o.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");k.roomUsers=[];for(let N=0;N<o.roomUsers.length;++N){if(typeof o.roomUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");k.roomUsers[N]=$root.com.quick.voice.proto.User.fromObject(o.roomUsers[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.roomUsers=[]),k.defaults&&(N.roomId="",N.hash=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.hash!=null&&o.hasOwnProperty("hash")&&(N.hash=o.hash),o.roomUsers&&o.roomUsers.length){N.roomUsers=[];for(let F=0;F<o.roomUsers.length;++F)N.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(o.roomUsers[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ToggleLiveRoomRsq"},O}(),j.TrackType=function(){const O={},I=Object.create(O);return I[O[0]="Microphone"]=0,I[O[1]="Camera"]=1,I[O[2]="Screen"]=2,I[O[3]="SystemVoice"]=3,I}(),j.ReportInfoReq=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.actionEvent="",O.prototype.userId="",O.prototype.platform="",O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.actionData="",O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.actionEvent!=null&&Object.hasOwnProperty.call(o,"actionEvent")&&k.uint32(10).string(o.actionEvent),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(18).string(o.userId),o.platform!=null&&Object.hasOwnProperty.call(o,"platform")&&k.uint32(26).string(o.platform),o.time!=null&&Object.hasOwnProperty.call(o,"time")&&k.uint32(32).int64(o.time),o.actionData!=null&&Object.hasOwnProperty.call(o,"actionData")&&k.uint32(42).string(o.actionData),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ReportInfoReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.actionEvent=o.string();break}case 2:{F.userId=o.string();break}case 3:{F.platform=o.string();break}case 4:{F.time=o.int64();break}case 5:{F.actionData=o.string();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){return typeof o!="object"||o===null?"object expected":o.actionEvent!=null&&o.hasOwnProperty("actionEvent")&&!$util.isString(o.actionEvent)?"actionEvent: string expected":o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId)?"userId: string expected":o.platform!=null&&o.hasOwnProperty("platform")&&!$util.isString(o.platform)?"platform: string expected":o.time!=null&&o.hasOwnProperty("time")&&!$util.isInteger(o.time)&&!(o.time&&$util.isInteger(o.time.low)&&$util.isInteger(o.time.high))?"time: integer|Long expected":o.actionData!=null&&o.hasOwnProperty("actionData")&&!$util.isString(o.actionData)?"actionData: string expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ReportInfoReq)return o;let k=new $root.com.quick.voice.proto.ReportInfoReq;return o.actionEvent!=null&&(k.actionEvent=String(o.actionEvent)),o.userId!=null&&(k.userId=String(o.userId)),o.platform!=null&&(k.platform=String(o.platform)),o.time!=null&&($util.Long?(k.time=$util.Long.fromValue(o.time)).unsigned=!1:typeof o.time=="string"?k.time=parseInt(o.time,10):typeof o.time=="number"?k.time=o.time:typeof o.time=="object"&&(k.time=new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber())),o.actionData!=null&&(k.actionData=String(o.actionData)),k},O.toObject=function(o,k){k||(k={});let N={};if(k.defaults){if(N.actionEvent="",N.userId="",N.platform="",$util.Long){let F=new $util.Long(0,0,!1);N.time=k.longs===String?F.toString():k.longs===Number?F.toNumber():F}else N.time=k.longs===String?"0":0;N.actionData=""}return o.actionEvent!=null&&o.hasOwnProperty("actionEvent")&&(N.actionEvent=o.actionEvent),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.platform!=null&&o.hasOwnProperty("platform")&&(N.platform=o.platform),o.time!=null&&o.hasOwnProperty("time")&&(typeof o.time=="number"?N.time=k.longs===String?String(o.time):o.time:N.time=k.longs===String?$util.Long.prototype.toString.call(o.time):k.longs===Number?new $util.LongBits(o.time.low>>>0,o.time.high>>>0).toNumber():o.time),o.actionData!=null&&o.hasOwnProperty("actionData")&&(N.actionData=o.actionData),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ReportInfoReq"},O}(),j.UpdatePermissions=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.user!=null&&Object.hasOwnProperty.call(o,"user")&&$root.com.quick.voice.proto.User.encode(o.user,k.uint32(18).fork()).ldelim(),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UpdatePermissions;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(o,o.uint32());break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.user!=null&&o.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(o.user);if(k)return"user."+k}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UpdatePermissions)return o;let k=new $root.com.quick.voice.proto.UpdatePermissions;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.user!=null){if(typeof o.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(o.user)}return k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.roomId="",N.user=null),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.user!=null&&o.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(o.user,k)),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UpdatePermissions"},O}(),j.CallType=function(){const O={},I=Object.create(O);return I[O[0]="Normal"]=0,I[O[1]="Meeting"]=1,I[O[2]="Live"]=2,I}(),j.QuitNotifyCode=function(){const O={},I=Object.create(O);return I[O[0]="NormalQuit"]=0,I[O[2021]="Timeout"]=2021,I[O[2011]="TokenExpired"]=2011,I[O[2022]="KickOut"]=2022,I[O[2023]="EndPk"]=2023,I[O[2024]="EndLive"]=2024,I}(),j.UserBehavior=function(){function O(I){if(I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.type=0,O.prototype.behavior=!1,O.create=function(o){return new O(o)},O.encode=function(o,k){return k||(k=$Writer.create()),o.type!=null&&Object.hasOwnProperty.call(o,"type")&&k.uint32(8).int32(o.type),o.behavior!=null&&Object.hasOwnProperty.call(o,"behavior")&&k.uint32(16).bool(o.behavior),k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UserBehavior;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.type=o.int32();break}case 2:{F.behavior=o.bool();break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.type!=null&&o.hasOwnProperty("type"))switch(o.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return o.behavior!=null&&o.hasOwnProperty("behavior")&&typeof o.behavior!="boolean"?"behavior: boolean expected":null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UserBehavior)return o;let k=new $root.com.quick.voice.proto.UserBehavior;switch(o.type){default:if(typeof o.type=="number"){k.type=o.type;break}break;case"Microphone":case 0:k.type=0;break;case"Camera":case 1:k.type=1;break;case"Screen":case 2:k.type=2;break;case"SystemVoice":case 3:k.type=3;break}return o.behavior!=null&&(k.behavior=!!o.behavior),k},O.toObject=function(o,k){k||(k={});let N={};return k.defaults&&(N.type=k.enums===String?"Microphone":0,N.behavior=!1),o.type!=null&&o.hasOwnProperty("type")&&(N.type=k.enums===String?$root.com.quick.voice.proto.TrackType[o.type]===void 0?o.type:$root.com.quick.voice.proto.TrackType[o.type]:o.type),o.behavior!=null&&o.hasOwnProperty("behavior")&&(N.behavior=o.behavior),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UserBehavior"},O}(),j.PreventUser=function(){function O(I){if(this.behaviors=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.id="",O.prototype.behaviors=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.id!=null&&Object.hasOwnProperty.call(o,"id")&&k.uint32(10).string(o.id),o.behaviors!=null&&o.behaviors.length)for(let N=0;N<o.behaviors.length;++N)$root.com.quick.voice.proto.UserBehavior.encode(o.behaviors[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.PreventUser;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.id=o.string();break}case 2:{F.behaviors&&F.behaviors.length||(F.behaviors=[]),F.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.id!=null&&o.hasOwnProperty("id")&&!$util.isString(o.id))return"id: string expected";if(o.behaviors!=null&&o.hasOwnProperty("behaviors")){if(!Array.isArray(o.behaviors))return"behaviors: array expected";for(let k=0;k<o.behaviors.length;++k){let N=$root.com.quick.voice.proto.UserBehavior.verify(o.behaviors[k]);if(N)return"behaviors."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PreventUser)return o;let k=new $root.com.quick.voice.proto.PreventUser;if(o.id!=null&&(k.id=String(o.id)),o.behaviors){if(!Array.isArray(o.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");k.behaviors=[];for(let N=0;N<o.behaviors.length;++N){if(typeof o.behaviors[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");k.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.fromObject(o.behaviors[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.behaviors=[]),k.defaults&&(N.id=""),o.id!=null&&o.hasOwnProperty("id")&&(N.id=o.id),o.behaviors&&o.behaviors.length){N.behaviors=[];for(let F=0;F<o.behaviors.length;++F)N.behaviors[F]=$root.com.quick.voice.proto.UserBehavior.toObject(o.behaviors[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PreventUser"},O}(),j.PreventUsersBehaviorReq=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.PreventUser.encode(o.users[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.PreventUser.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.PreventUser.verify(o.users[k]);if(N)return"users."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return o;let k=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");k.users[N]=$root.com.quick.voice.proto.PreventUser.fromObject(o.users[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),k.defaults&&(N.roomId=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.PreventUser.toObject(o.users[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PreventUsersBehaviorReq"},O}(),j.PreventUsersBehaviorNotify=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.roomId!=null&&Object.hasOwnProperty.call(o,"roomId")&&k.uint32(10).string(o.roomId),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.User.encode(o.users[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.roomId=o.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.roomId!=null&&o.hasOwnProperty("roomId")&&!$util.isString(o.roomId))return"roomId: string expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.User.verify(o.users[k]);if(N)return"users."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return o;let k=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(o.roomId!=null&&(k.roomId=String(o.roomId)),o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");k.users[N]=$root.com.quick.voice.proto.User.fromObject(o.users[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),k.defaults&&(N.roomId=""),o.roomId!=null&&o.hasOwnProperty("roomId")&&(N.roomId=o.roomId),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(o.users[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},O}(),j.AccelerationAreas=function(){const O={},I=Object.create(O);return I[O[0]="chinaMainland"]=0,I[O[1]="global"]=1,I[O[2]="overseas"]=2,I}(),j.CountMethods=function(){const O={},I=Object.create(O);return I[O[0]="flow"]=0,I[O[1]="minutes"]=1,I}(),j.BaseCDNAddress=function(){function O(I){if(this.urlMap={},I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.area=0,O.prototype.countType=0,O.prototype.urlMap=$util.emptyObject,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.area!=null&&Object.hasOwnProperty.call(o,"area")&&k.uint32(8).int32(o.area),o.countType!=null&&Object.hasOwnProperty.call(o,"countType")&&k.uint32(16).int32(o.countType),o.urlMap!=null&&Object.hasOwnProperty.call(o,"urlMap"))for(let N=Object.keys(o.urlMap),F=0;F<N.length;++F)k.uint32(26).fork().uint32(10).string(N[F]).uint32(18).string(o.urlMap[N[F]]).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.BaseCDNAddress,J,X;for(;o.pos<N;){let Y=o.uint32();switch(Y>>>3){case 1:{F.area=o.int32();break}case 2:{F.countType=o.int32();break}case 3:{F.urlMap===$util.emptyObject&&(F.urlMap={});let Q=o.uint32()+o.pos;for(J="",X="";o.pos<Q;){let te=o.uint32();switch(te>>>3){case 1:J=o.string();break;case 2:X=o.string();break;default:o.skipType(te&7);break}}F.urlMap[J]=X;break}default:o.skipType(Y&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.area!=null&&o.hasOwnProperty("area"))switch(o.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(o.countType!=null&&o.hasOwnProperty("countType"))switch(o.countType){default:return"countType: enum value expected";case 0:case 1:break}if(o.urlMap!=null&&o.hasOwnProperty("urlMap")){if(!$util.isObject(o.urlMap))return"urlMap: object expected";let k=Object.keys(o.urlMap);for(let N=0;N<k.length;++N)if(!$util.isString(o.urlMap[k[N]]))return"urlMap: string{k:string} expected"}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.BaseCDNAddress)return o;let k=new $root.com.quick.voice.proto.BaseCDNAddress;switch(o.area){default:if(typeof o.area=="number"){k.area=o.area;break}break;case"chinaMainland":case 0:k.area=0;break;case"global":case 1:k.area=1;break;case"overseas":case 2:k.area=2;break}switch(o.countType){default:if(typeof o.countType=="number"){k.countType=o.countType;break}break;case"flow":case 0:k.countType=0;break;case"minutes":case 1:k.countType=1;break}if(o.urlMap){if(typeof o.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");k.urlMap={};for(let N=Object.keys(o.urlMap),F=0;F<N.length;++F)k.urlMap[N[F]]=String(o.urlMap[N[F]])}return k},O.toObject=function(o,k){k||(k={});let N={};(k.objects||k.defaults)&&(N.urlMap={}),k.defaults&&(N.area=k.enums===String?"chinaMainland":0,N.countType=k.enums===String?"flow":0),o.area!=null&&o.hasOwnProperty("area")&&(N.area=k.enums===String?$root.com.quick.voice.proto.AccelerationAreas[o.area]===void 0?o.area:$root.com.quick.voice.proto.AccelerationAreas[o.area]:o.area),o.countType!=null&&o.hasOwnProperty("countType")&&(N.countType=k.enums===String?$root.com.quick.voice.proto.CountMethods[o.countType]===void 0?o.countType:$root.com.quick.voice.proto.CountMethods[o.countType]:o.countType);let F;if(o.urlMap&&(F=Object.keys(o.urlMap)).length){N.urlMap={};for(let J=0;J<F.length;++J)N.urlMap[F[J]]=o.urlMap[F[J]]}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.BaseCDNAddress"},O}(),j.CDNPlayAddressNotify=function(){function O(o){if(this.standLines=[],o)for(let k=Object.keys(o),N=0;N<k.length;++N)o[k[N]]!=null&&(this[k[N]]=o[k[N]])}O.prototype.roomId="",O.prototype.m3u8=null,O.prototype.rtmp=null,O.prototype.flv=null,O.prototype.rtmps=null,O.prototype.mainLine=null,O.prototype.standLines=$util.emptyArray;let I;return Object.defineProperty(O.prototype,"_m3u8",{get:$util.oneOfGetter(I=["m3u8"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_rtmp",{get:$util.oneOfGetter(I=["rtmp"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_flv",{get:$util.oneOfGetter(I=["flv"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_rtmps",{get:$util.oneOfGetter(I=["rtmps"]),set:$util.oneOfSetter(I)}),Object.defineProperty(O.prototype,"_mainLine",{get:$util.oneOfGetter(I=["mainLine"]),set:$util.oneOfSetter(I)}),O.create=function(k){return new O(k)},O.encode=function(k,N){if(N||(N=$Writer.create()),k.roomId!=null&&Object.hasOwnProperty.call(k,"roomId")&&N.uint32(10).string(k.roomId),k.m3u8!=null&&Object.hasOwnProperty.call(k,"m3u8")&&N.uint32(18).string(k.m3u8),k.rtmp!=null&&Object.hasOwnProperty.call(k,"rtmp")&&N.uint32(26).string(k.rtmp),k.flv!=null&&Object.hasOwnProperty.call(k,"flv")&&N.uint32(34).string(k.flv),k.rtmps!=null&&Object.hasOwnProperty.call(k,"rtmps")&&N.uint32(42).string(k.rtmps),k.mainLine!=null&&Object.hasOwnProperty.call(k,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(k.mainLine,N.uint32(50).fork()).ldelim(),k.standLines!=null&&k.standLines.length)for(let F=0;F<k.standLines.length;++F)$root.com.quick.voice.proto.BaseCDNAddress.encode(k.standLines[F],N.uint32(58).fork()).ldelim();return N},O.encodeDelimited=function(k,N){return this.encode(k,N).ldelim()},O.decode=function(k,N){k instanceof $Reader||(k=$Reader.create(k));let F=N===void 0?k.len:k.pos+N,J=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;k.pos<F;){let X=k.uint32();switch(X>>>3){case 1:{J.roomId=k.string();break}case 2:{J.m3u8=k.string();break}case 3:{J.rtmp=k.string();break}case 4:{J.flv=k.string();break}case 5:{J.rtmps=k.string();break}case 6:{J.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(k,k.uint32());break}case 7:{J.standLines&&J.standLines.length||(J.standLines=[]),J.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(k,k.uint32()));break}default:k.skipType(X&7);break}}return J},O.decodeDelimited=function(k){return k instanceof $Reader||(k=new $Reader(k)),this.decode(k,k.uint32())},O.verify=function(k){if(typeof k!="object"||k===null)return"object expected";if(k.roomId!=null&&k.hasOwnProperty("roomId")&&!$util.isString(k.roomId))return"roomId: string expected";if(k.m3u8!=null&&k.hasOwnProperty("m3u8")&&!$util.isString(k.m3u8))return"m3u8: string expected";if(k.rtmp!=null&&k.hasOwnProperty("rtmp")&&!$util.isString(k.rtmp))return"rtmp: string expected";if(k.flv!=null&&k.hasOwnProperty("flv")&&!$util.isString(k.flv))return"flv: string expected";if(k.rtmps!=null&&k.hasOwnProperty("rtmps")&&!$util.isString(k.rtmps))return"rtmps: string expected";if(k.mainLine!=null&&k.hasOwnProperty("mainLine")){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(k.mainLine);if(N)return"mainLine."+N}if(k.standLines!=null&&k.hasOwnProperty("standLines")){if(!Array.isArray(k.standLines))return"standLines: array expected";for(let N=0;N<k.standLines.length;++N){let F=$root.com.quick.voice.proto.BaseCDNAddress.verify(k.standLines[N]);if(F)return"standLines."+F}}return null},O.fromObject=function(k){if(k instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return k;let N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(k.roomId!=null&&(N.roomId=String(k.roomId)),k.m3u8!=null&&(N.m3u8=String(k.m3u8)),k.rtmp!=null&&(N.rtmp=String(k.rtmp)),k.flv!=null&&(N.flv=String(k.flv)),k.rtmps!=null&&(N.rtmps=String(k.rtmps)),k.mainLine!=null){if(typeof k.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(k.mainLine)}if(k.standLines){if(!Array.isArray(k.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");N.standLines=[];for(let F=0;F<k.standLines.length;++F){if(typeof k.standLines[F]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");N.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(k.standLines[F])}}return N},O.toObject=function(k,N){N||(N={});let F={};if((N.arrays||N.defaults)&&(F.standLines=[]),N.defaults&&(F.roomId=""),k.roomId!=null&&k.hasOwnProperty("roomId")&&(F.roomId=k.roomId),k.m3u8!=null&&k.hasOwnProperty("m3u8")&&(F.m3u8=k.m3u8,N.oneofs&&(F._m3u8="m3u8")),k.rtmp!=null&&k.hasOwnProperty("rtmp")&&(F.rtmp=k.rtmp,N.oneofs&&(F._rtmp="rtmp")),k.flv!=null&&k.hasOwnProperty("flv")&&(F.flv=k.flv,N.oneofs&&(F._flv="flv")),k.rtmps!=null&&k.hasOwnProperty("rtmps")&&(F.rtmps=k.rtmps,N.oneofs&&(F._rtmps="rtmps")),k.mainLine!=null&&k.hasOwnProperty("mainLine")&&(F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(k.mainLine,N),N.oneofs&&(F._mainLine="mainLine")),k.standLines&&k.standLines.length){F.standLines=[];for(let J=0;J<k.standLines.length;++J)F.standLines[J]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(k.standLines[J],N)}return F},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(k){return k===void 0&&(k="type.googleapis.com"),k+"/com.quick.voice.proto.CDNPlayAddressNotify"},O}(),j.UserChannel=function(){function O(I){if(this.channels=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.userId="",O.prototype.channels=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.userId!=null&&Object.hasOwnProperty.call(o,"userId")&&k.uint32(10).string(o.userId),o.channels!=null&&o.channels.length)for(let N=0;N<o.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(o.channels[N],k.uint32(18).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.UserChannel;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.userId=o.string();break}case 2:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.userId!=null&&o.hasOwnProperty("userId")&&!$util.isString(o.userId))return"userId: string expected";if(o.channels!=null&&o.hasOwnProperty("channels")){if(!Array.isArray(o.channels))return"channels: array expected";for(let k=0;k<o.channels.length;++k){let N=$root.com.quick.voice.proto.DataChannel.verify(o.channels[k]);if(N)return"channels."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.UserChannel)return o;let k=new $root.com.quick.voice.proto.UserChannel;if(o.userId!=null&&(k.userId=String(o.userId)),o.channels){if(!Array.isArray(o.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");k.channels=[];for(let N=0;N<o.channels.length;++N){if(typeof o.channels[N]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");k.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(o.channels[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.channels=[]),k.defaults&&(N.userId=""),o.userId!=null&&o.hasOwnProperty("userId")&&(N.userId=o.userId),o.channels&&o.channels.length){N.channels=[];for(let F=0;F<o.channels.length;++F)N.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(o.channels[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.UserChannel"},O}(),j.ChannelPublishReq=function(){function O(I){if(this.channels=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.channels=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.channels!=null&&o.channels.length)for(let N=0;N<o.channels.length;++N)$root.com.quick.voice.proto.DataChannel.encode(o.channels[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ChannelPublishReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.channels!=null&&o.hasOwnProperty("channels")){if(!Array.isArray(o.channels))return"channels: array expected";for(let k=0;k<o.channels.length;++k){let N=$root.com.quick.voice.proto.DataChannel.verify(o.channels[k]);if(N)return"channels."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ChannelPublishReq)return o;let k=new $root.com.quick.voice.proto.ChannelPublishReq;if(o.channels){if(!Array.isArray(o.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");k.channels=[];for(let N=0;N<o.channels.length;++N){if(typeof o.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");k.channels[N]=$root.com.quick.voice.proto.DataChannel.fromObject(o.channels[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.channels=[]),o.channels&&o.channels.length){N.channels=[];for(let F=0;F<o.channels.length;++F)N.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(o.channels[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ChannelPublishReq"},O}(),j.ChannelPublishRsq=function(){function O(I){if(this.channels=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.channels=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.channels!=null&&o.channels.length)for(let N=0;N<o.channels.length;++N)$root.com.quick.voice.proto.UserChannel.encode(o.channels[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.channels!=null&&o.hasOwnProperty("channels")){if(!Array.isArray(o.channels))return"channels: array expected";for(let k=0;k<o.channels.length;++k){let N=$root.com.quick.voice.proto.UserChannel.verify(o.channels[k]);if(N)return"channels."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return o;let k=new $root.com.quick.voice.proto.ChannelPublishRsq;if(o.channels){if(!Array.isArray(o.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");k.channels=[];for(let N=0;N<o.channels.length;++N){if(typeof o.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");k.channels[N]=$root.com.quick.voice.proto.UserChannel.fromObject(o.channels[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.channels=[]),o.channels&&o.channels.length){N.channels=[];for(let F=0;F<o.channels.length;++F)N.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(o.channels[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ChannelPublishRsq"},O}(),j.ChannelSubscribeReq=function(){function O(I){if(this.users=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.users=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.users!=null&&o.users.length)for(let N=0;N<o.users.length;++N)$root.com.quick.voice.proto.UserChannel.encode(o.users[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.UserChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.users!=null&&o.hasOwnProperty("users")){if(!Array.isArray(o.users))return"users: array expected";for(let k=0;k<o.users.length;++k){let N=$root.com.quick.voice.proto.UserChannel.verify(o.users[k]);if(N)return"users."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return o;let k=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(o.users){if(!Array.isArray(o.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");k.users=[];for(let N=0;N<o.users.length;++N){if(typeof o.users[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");k.users[N]=$root.com.quick.voice.proto.UserChannel.fromObject(o.users[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.users=[]),o.users&&o.users.length){N.users=[];for(let F=0;F<o.users.length;++F)N.users[F]=$root.com.quick.voice.proto.UserChannel.toObject(o.users[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ChannelSubscribeReq"},O}(),j.ChannelSubscribeRsq=function(){function O(I){if(this.channels=[],I)for(let o=Object.keys(I),k=0;k<o.length;++k)I[o[k]]!=null&&(this[o[k]]=I[o[k]])}return O.prototype.channels=$util.emptyArray,O.create=function(o){return new O(o)},O.encode=function(o,k){if(k||(k=$Writer.create()),o.channels!=null&&o.channels.length)for(let N=0;N<o.channels.length;++N)$root.com.quick.voice.proto.UserChannel.encode(o.channels[N],k.uint32(10).fork()).ldelim();return k},O.encodeDelimited=function(o,k){return this.encode(o,k).ldelim()},O.decode=function(o,k){o instanceof $Reader||(o=$Reader.create(o));let N=k===void 0?o.len:o.pos+k,F=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;o.pos<N;){let J=o.uint32();switch(J>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(o,o.uint32()));break}default:o.skipType(J&7);break}}return F},O.decodeDelimited=function(o){return o instanceof $Reader||(o=new $Reader(o)),this.decode(o,o.uint32())},O.verify=function(o){if(typeof o!="object"||o===null)return"object expected";if(o.channels!=null&&o.hasOwnProperty("channels")){if(!Array.isArray(o.channels))return"channels: array expected";for(let k=0;k<o.channels.length;++k){let N=$root.com.quick.voice.proto.UserChannel.verify(o.channels[k]);if(N)return"channels."+N}}return null},O.fromObject=function(o){if(o instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return o;let k=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(o.channels){if(!Array.isArray(o.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");k.channels=[];for(let N=0;N<o.channels.length;++N){if(typeof o.channels[N]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");k.channels[N]=$root.com.quick.voice.proto.UserChannel.fromObject(o.channels[N])}}return k},O.toObject=function(o,k){k||(k={});let N={};if((k.arrays||k.defaults)&&(N.channels=[]),o.channels&&o.channels.length){N.channels=[];for(let F=0;F<o.channels.length;++F)N.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(o.channels[F],k)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(o){return o===void 0&&(o="type.googleapis.com"),o+"/com.quick.voice.proto.ChannelSubscribeRsq"},O}(),j}(),D}(),z}(),$})(),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($){let z=$.length;for(;--z>=0;)$[z]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc($,z,D,j,O){this.static_tree=$,this.extra_bits=z,this.extra_base=D,this.elems=j,this.max_length=O,this.has_stree=$&&$.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc($,z){this.dyn_tree=$,this.max_code=0,this.stat_desc=z}const d_code=$=>$<256?_dist_code[$]:_dist_code[256+($>>>7)],put_short=($,z)=>{$.pending_buf[$.pending++]=z&255,$.pending_buf[$.pending++]=z>>>8&255},send_bits=($,z,D)=>{$.bi_valid>Buf_size-D?($.bi_buf|=z<<$.bi_valid&65535,put_short($,$.bi_buf),$.bi_buf=z>>Buf_size-$.bi_valid,$.bi_valid+=D-Buf_size):($.bi_buf|=z<<$.bi_valid&65535,$.bi_valid+=D)},send_code=($,z,D)=>{send_bits($,D[z*2],D[z*2+1])},bi_reverse=($,z)=>{let D=0;do D|=$&1,$>>>=1,D<<=1;while(--z>0);return D>>>1},bi_flush=$=>{$.bi_valid===16?(put_short($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):$.bi_valid>=8&&($.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8)},gen_bitlen=($,z)=>{const D=z.dyn_tree,j=z.max_code,O=z.stat_desc.static_tree,I=z.stat_desc.has_stree,o=z.stat_desc.extra_bits,k=z.stat_desc.extra_base,N=z.stat_desc.max_length;let F,J,X,Y,Q,te,ie=0;for(Y=0;Y<=MAX_BITS$1;Y++)$.bl_count[Y]=0;for(D[$.heap[$.heap_max]*2+1]=0,F=$.heap_max+1;F<HEAP_SIZE$1;F++)J=$.heap[F],Y=D[D[J*2+1]*2+1]+1,Y>N&&(Y=N,ie++),D[J*2+1]=Y,!(J>j)&&($.bl_count[Y]++,Q=0,J>=k&&(Q=o[J-k]),te=D[J*2],$.opt_len+=te*(Y+Q),I&&($.static_len+=te*(O[J*2+1]+Q)));if(ie!==0){do{for(Y=N-1;$.bl_count[Y]===0;)Y--;$.bl_count[Y]--,$.bl_count[Y+1]+=2,$.bl_count[N]--,ie-=2}while(ie>0);for(Y=N;Y!==0;Y--)for(J=$.bl_count[Y];J!==0;)X=$.heap[--F],!(X>j)&&(D[X*2+1]!==Y&&($.opt_len+=(Y-D[X*2+1])*D[X*2],D[X*2+1]=Y),J--)}},gen_codes=($,z,D)=>{const j=new Array(MAX_BITS$1+1);let O=0,I,o;for(I=1;I<=MAX_BITS$1;I++)O=O+D[I-1]<<1,j[I]=O;for(o=0;o<=z;o++){let k=$[o*2+1];k!==0&&($[o*2]=bi_reverse(j[k]++,k))}},tr_static_init=()=>{let $,z,D,j,O;const I=new Array(MAX_BITS$1+1);for(D=0,j=0;j<LENGTH_CODES$1-1;j++)for(base_length[j]=D,$=0;$<1<<extra_lbits[j];$++)_length_code[D++]=j;for(_length_code[D-1]=j,O=0,j=0;j<16;j++)for(base_dist[j]=O,$=0;$<1<<extra_dbits[j];$++)_dist_code[O++]=j;for(O>>=7;j<D_CODES$1;j++)for(base_dist[j]=O<<7,$=0;$<1<<extra_dbits[j]-7;$++)_dist_code[256+O++]=j;for(z=0;z<=MAX_BITS$1;z++)I[z]=0;for($=0;$<=143;)static_ltree[$*2+1]=8,$++,I[8]++;for(;$<=255;)static_ltree[$*2+1]=9,$++,I[9]++;for(;$<=279;)static_ltree[$*2+1]=7,$++,I[7]++;for(;$<=287;)static_ltree[$*2+1]=8,$++,I[8]++;for(gen_codes(static_ltree,L_CODES$1+1,I),$=0;$<D_CODES$1;$++)static_dtree[$*2+1]=5,static_dtree[$*2]=bi_reverse($,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=$=>{let z;for(z=0;z<L_CODES$1;z++)$.dyn_ltree[z*2]=0;for(z=0;z<D_CODES$1;z++)$.dyn_dtree[z*2]=0;for(z=0;z<BL_CODES$1;z++)$.bl_tree[z*2]=0;$.dyn_ltree[END_BLOCK*2]=1,$.opt_len=$.static_len=0,$.sym_next=$.matches=0},bi_windup=$=>{$.bi_valid>8?put_short($,$.bi_buf):$.bi_valid>0&&($.pending_buf[$.pending++]=$.bi_buf),$.bi_buf=0,$.bi_valid=0},smaller=($,z,D,j)=>{const O=z*2,I=D*2;return $[O]<$[I]||$[O]===$[I]&&j[z]<=j[D]},pqdownheap=($,z,D)=>{const j=$.heap[D];let O=D<<1;for(;O<=$.heap_len&&(O<$.heap_len&&smaller(z,$.heap[O+1],$.heap[O],$.depth)&&O++,!smaller(z,j,$.heap[O],$.depth));)$.heap[D]=$.heap[O],D=O,O<<=1;$.heap[D]=j},compress_block=($,z,D)=>{let j,O,I=0,o,k;if($.sym_next!==0)do j=$.pending_buf[$.sym_buf+I++]&255,j+=($.pending_buf[$.sym_buf+I++]&255)<<8,O=$.pending_buf[$.sym_buf+I++],j===0?send_code($,O,z):(o=_length_code[O],send_code($,o+LITERALS$1+1,z),k=extra_lbits[o],k!==0&&(O-=base_length[o],send_bits($,O,k)),j--,o=d_code(j),send_code($,o,D),k=extra_dbits[o],k!==0&&(j-=base_dist[o],send_bits($,j,k)));while(I<$.sym_next);send_code($,END_BLOCK,z)},build_tree=($,z)=>{const D=z.dyn_tree,j=z.stat_desc.static_tree,O=z.stat_desc.has_stree,I=z.stat_desc.elems;let o,k,N=-1,F;for($.heap_len=0,$.heap_max=HEAP_SIZE$1,o=0;o<I;o++)D[o*2]!==0?($.heap[++$.heap_len]=N=o,$.depth[o]=0):D[o*2+1]=0;for(;$.heap_len<2;)F=$.heap[++$.heap_len]=N<2?++N:0,D[F*2]=1,$.depth[F]=0,$.opt_len--,O&&($.static_len-=j[F*2+1]);for(z.max_code=N,o=$.heap_len>>1;o>=1;o--)pqdownheap($,D,o);F=I;do o=$.heap[1],$.heap[1]=$.heap[$.heap_len--],pqdownheap($,D,1),k=$.heap[1],$.heap[--$.heap_max]=o,$.heap[--$.heap_max]=k,D[F*2]=D[o*2]+D[k*2],$.depth[F]=($.depth[o]>=$.depth[k]?$.depth[o]:$.depth[k])+1,D[o*2+1]=D[k*2+1]=F,$.heap[1]=F++,pqdownheap($,D,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],gen_bitlen($,z),gen_codes(D,N,$.bl_count)},scan_tree=($,z,D)=>{let j,O=-1,I,o=z[0*2+1],k=0,N=7,F=4;for(o===0&&(N=138,F=3),z[(D+1)*2+1]=65535,j=0;j<=D;j++)I=o,o=z[(j+1)*2+1],!(++k<N&&I===o)&&(k<F?$.bl_tree[I*2]+=k:I!==0?(I!==O&&$.bl_tree[I*2]++,$.bl_tree[REP_3_6*2]++):k<=10?$.bl_tree[REPZ_3_10*2]++:$.bl_tree[REPZ_11_138*2]++,k=0,O=I,o===0?(N=138,F=3):I===o?(N=6,F=3):(N=7,F=4))},send_tree=($,z,D)=>{let j,O=-1,I,o=z[0*2+1],k=0,N=7,F=4;for(o===0&&(N=138,F=3),j=0;j<=D;j++)if(I=o,o=z[(j+1)*2+1],!(++k<N&&I===o)){if(k<F)do send_code($,I,$.bl_tree);while(--k!==0);else I!==0?(I!==O&&(send_code($,I,$.bl_tree),k--),send_code($,REP_3_6,$.bl_tree),send_bits($,k-3,2)):k<=10?(send_code($,REPZ_3_10,$.bl_tree),send_bits($,k-3,3)):(send_code($,REPZ_11_138,$.bl_tree),send_bits($,k-11,7));k=0,O=I,o===0?(N=138,F=3):I===o?(N=6,F=3):(N=7,F=4)}},build_bl_tree=$=>{let z;for(scan_tree($,$.dyn_ltree,$.l_desc.max_code),scan_tree($,$.dyn_dtree,$.d_desc.max_code),build_tree($,$.bl_desc),z=BL_CODES$1-1;z>=3&&$.bl_tree[bl_order[z]*2+1]===0;z--);return $.opt_len+=3*(z+1)+5+5+4,z},send_all_trees=($,z,D,j)=>{let O;for(send_bits($,z-257,5),send_bits($,D-1,5),send_bits($,j-4,4),O=0;O<j;O++)send_bits($,$.bl_tree[bl_order[O]*2+1],3);send_tree($,$.dyn_ltree,z-1),send_tree($,$.dyn_dtree,D-1)},detect_data_type=$=>{let z=4093624447,D;for(D=0;D<=31;D++,z>>>=1)if(z&1&&$.dyn_ltree[D*2]!==0)return Z_BINARY;if($.dyn_ltree[9*2]!==0||$.dyn_ltree[10*2]!==0||$.dyn_ltree[13*2]!==0)return Z_TEXT;for(D=32;D<LITERALS$1;D++)if($.dyn_ltree[D*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=$=>{static_init_done||(tr_static_init(),static_init_done=!0),$.l_desc=new TreeDesc($.dyn_ltree,static_l_desc),$.d_desc=new TreeDesc($.dyn_dtree,static_d_desc),$.bl_desc=new TreeDesc($.bl_tree,static_bl_desc),$.bi_buf=0,$.bi_valid=0,init_block($)},_tr_stored_block$1=($,z,D,j)=>{send_bits($,(STORED_BLOCK<<1)+(j?1:0),3),bi_windup($),put_short($,D),put_short($,~D),D&&$.pending_buf.set($.window.subarray(z,z+D),$.pending),$.pending+=D},_tr_align$1=$=>{send_bits($,STATIC_TREES<<1,3),send_code($,END_BLOCK,static_ltree),bi_flush($)},_tr_flush_block$1=($,z,D,j)=>{let O,I,o=0;$.level>0?($.strm.data_type===Z_UNKNOWN$1&&($.strm.data_type=detect_data_type($)),build_tree($,$.l_desc),build_tree($,$.d_desc),o=build_bl_tree($),O=$.opt_len+3+7>>>3,I=$.static_len+3+7>>>3,I<=O&&(O=I)):O=I=D+5,D+4<=O&&z!==-1?_tr_stored_block$1($,z,D,j):$.strategy===Z_FIXED$1||I===O?(send_bits($,(STATIC_TREES<<1)+(j?1:0),3),compress_block($,static_ltree,static_dtree)):(send_bits($,(DYN_TREES<<1)+(j?1:0),3),send_all_trees($,$.l_desc.max_code+1,$.d_desc.max_code+1,o+1),compress_block($,$.dyn_ltree,$.dyn_dtree)),init_block($),j&&bi_windup($)},_tr_tally$1=($,z,D)=>($.pending_buf[$.sym_buf+$.sym_next++]=z,$.pending_buf[$.sym_buf+$.sym_next++]=z>>8,$.pending_buf[$.sym_buf+$.sym_next++]=D,z===0?$.dyn_ltree[D*2]++:($.matches++,z--,$.dyn_ltree[(_length_code[D]+LITERALS$1+1)*2]++,$.dyn_dtree[d_code(z)*2]++),$.sym_next===$.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=($,z,D,j)=>{let O=$&65535|0,I=$>>>16&65535|0,o=0;for(;D!==0;){o=D>2e3?2e3:D,D-=o;do O=O+z[j++]|0,I=I+O|0;while(--o);O%=65521,I%=65521}return O|I<<16|0};var adler32_1=adler32;const makeTable=()=>{let $,z=[];for(var D=0;D<256;D++){$=D;for(var j=0;j<8;j++)$=$&1?3988292384^$>>>1:$>>>1;z[D]=$}return z},crcTable=new Uint32Array(makeTable()),crc32=($,z,D,j)=>{const O=crcTable,I=j+D;$^=-1;for(let o=j;o<I;o++)$=$>>>8^O[($^z[o])&255];return $^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=($,z)=>($.msg=messages[z],z),rank=$=>$*2-($>4?9:0),zero=$=>{let z=$.length;for(;--z>=0;)$[z]=0},slide_hash=$=>{let z,D,j,O=$.w_size;z=$.hash_size,j=z;do D=$.head[--j],$.head[j]=D>=O?D-O:0;while(--z);z=O,j=z;do D=$.prev[--j],$.prev[j]=D>=O?D-O:0;while(--z)};let HASH_ZLIB=($,z,D)=>(z<<$.hash_shift^D)&$.hash_mask,HASH=HASH_ZLIB;const flush_pending=$=>{const z=$.state;let D=z.pending;D>$.avail_out&&(D=$.avail_out),D!==0&&($.output.set(z.pending_buf.subarray(z.pending_out,z.pending_out+D),$.next_out),$.next_out+=D,z.pending_out+=D,$.total_out+=D,$.avail_out-=D,z.pending-=D,z.pending===0&&(z.pending_out=0))},flush_block_only=($,z)=>{_tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,z),$.block_start=$.strstart,flush_pending($.strm)},put_byte=($,z)=>{$.pending_buf[$.pending++]=z},putShortMSB=($,z)=>{$.pending_buf[$.pending++]=z>>>8&255,$.pending_buf[$.pending++]=z&255},read_buf=($,z,D,j)=>{let O=$.avail_in;return O>j&&(O=j),O===0?0:($.avail_in-=O,z.set($.input.subarray($.next_in,$.next_in+O),D),$.state.wrap===1?$.adler=adler32_1($.adler,z,O,D):$.state.wrap===2&&($.adler=crc32_1($.adler,z,O,D)),$.next_in+=O,$.total_in+=O,O)},longest_match=($,z)=>{let D=$.max_chain_length,j=$.strstart,O,I,o=$.prev_length,k=$.nice_match;const N=$.strstart>$.w_size-MIN_LOOKAHEAD?$.strstart-($.w_size-MIN_LOOKAHEAD):0,F=$.window,J=$.w_mask,X=$.prev,Y=$.strstart+MAX_MATCH;let Q=F[j+o-1],te=F[j+o];$.prev_length>=$.good_match&&(D>>=2),k>$.lookahead&&(k=$.lookahead);do if(O=z,!(F[O+o]!==te||F[O+o-1]!==Q||F[O]!==F[j]||F[++O]!==F[j+1])){j+=2,O++;do;while(F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&F[++j]===F[++O]&&j<Y);if(I=MAX_MATCH-(Y-j),j=Y-MAX_MATCH,I>o){if($.match_start=z,o=I,I>=k)break;Q=F[j+o-1],te=F[j+o]}}while((z=X[z&J])>N&&--D!==0);return o<=$.lookahead?o:$.lookahead},fill_window=$=>{const z=$.w_size;let D,j,O;do{if(j=$.window_size-$.lookahead-$.strstart,$.strstart>=z+(z-MIN_LOOKAHEAD)&&($.window.set($.window.subarray(z,z+z-j),0),$.match_start-=z,$.strstart-=z,$.block_start-=z,$.insert>$.strstart&&($.insert=$.strstart),slide_hash($),j+=z),$.strm.avail_in===0)break;if(D=read_buf($.strm,$.window,$.strstart+$.lookahead,j),$.lookahead+=D,$.lookahead+$.insert>=MIN_MATCH)for(O=$.strstart-$.insert,$.ins_h=$.window[O],$.ins_h=HASH($,$.ins_h,$.window[O+1]);$.insert&&($.ins_h=HASH($,$.ins_h,$.window[O+MIN_MATCH-1]),$.prev[O&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=O,O++,$.insert--,!($.lookahead+$.insert<MIN_MATCH)););}while($.lookahead<MIN_LOOKAHEAD&&$.strm.avail_in!==0)},deflate_stored=($,z)=>{let D=$.pending_buf_size-5>$.w_size?$.w_size:$.pending_buf_size-5,j,O,I,o=0,k=$.strm.avail_in;do{if(j=65535,I=$.bi_valid+42>>3,$.strm.avail_out<I||(I=$.strm.avail_out-I,O=$.strstart-$.block_start,j>O+$.strm.avail_in&&(j=O+$.strm.avail_in),j>I&&(j=I),j<D&&(j===0&&z!==Z_FINISH$3||z===Z_NO_FLUSH$2||j!==O+$.strm.avail_in)))break;o=z===Z_FINISH$3&&j===O+$.strm.avail_in?1:0,_tr_stored_block($,0,0,o),$.pending_buf[$.pending-4]=j,$.pending_buf[$.pending-3]=j>>8,$.pending_buf[$.pending-2]=~j,$.pending_buf[$.pending-1]=~j>>8,flush_pending($.strm),O&&(O>j&&(O=j),$.strm.output.set($.window.subarray($.block_start,$.block_start+O),$.strm.next_out),$.strm.next_out+=O,$.strm.avail_out-=O,$.strm.total_out+=O,$.block_start+=O,j-=O),j&&(read_buf($.strm,$.strm.output,$.strm.next_out,j),$.strm.next_out+=j,$.strm.avail_out-=j,$.strm.total_out+=j)}while(o===0);return k-=$.strm.avail_in,k&&(k>=$.w_size?($.matches=2,$.window.set($.strm.input.subarray($.strm.next_in-$.w_size,$.strm.next_in),0),$.strstart=$.w_size,$.insert=$.strstart):($.window_size-$.strstart<=k&&($.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,$.insert>$.strstart&&($.insert=$.strstart)),$.window.set($.strm.input.subarray($.strm.next_in-k,$.strm.next_in),$.strstart),$.strstart+=k,$.insert+=k>$.w_size-$.insert?$.w_size-$.insert:k),$.block_start=$.strstart),$.high_water<$.strstart&&($.high_water=$.strstart),o?BS_FINISH_DONE:z!==Z_NO_FLUSH$2&&z!==Z_FINISH$3&&$.strm.avail_in===0&&$.strstart===$.block_start?BS_BLOCK_DONE:(I=$.window_size-$.strstart,$.strm.avail_in>I&&$.block_start>=$.w_size&&($.block_start-=$.w_size,$.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,I+=$.w_size,$.insert>$.strstart&&($.insert=$.strstart)),I>$.strm.avail_in&&(I=$.strm.avail_in),I&&(read_buf($.strm,$.window,$.strstart,I),$.strstart+=I,$.insert+=I>$.w_size-$.insert?$.w_size-$.insert:I),$.high_water<$.strstart&&($.high_water=$.strstart),I=$.bi_valid+42>>3,I=$.pending_buf_size-I>65535?65535:$.pending_buf_size-I,D=I>$.w_size?$.w_size:I,O=$.strstart-$.block_start,(O>=D||(O||z===Z_FINISH$3)&&z!==Z_NO_FLUSH$2&&$.strm.avail_in===0&&O<=I)&&(j=O>I?I:O,o=z===Z_FINISH$3&&$.strm.avail_in===0&&j===O?1:0,_tr_stored_block($,$.block_start,j,o),$.block_start+=j,flush_pending($.strm)),o?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=($,z)=>{let D,j;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&z===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(D=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),D=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),D!==0&&$.strstart-D<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,D)),$.match_length>=MIN_MATCH)if(j=_tr_tally($,$.strstart-$.match_start,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=MIN_MATCH){$.match_length--;do $.strstart++,$.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),D=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=HASH($,$.ins_h,$.window[$.strstart+1]);else j=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(j&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,z===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=($,z)=>{let D,j,O;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&z===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(D=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),D=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),$.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=MIN_MATCH-1,D!==0&&$.prev_length<$.max_lazy_match&&$.strstart-D<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,D),$.match_length<=5&&($.strategy===Z_FILTERED||$.match_length===MIN_MATCH&&$.strstart-$.match_start>4096)&&($.match_length=MIN_MATCH-1)),$.prev_length>=MIN_MATCH&&$.match_length<=$.prev_length){O=$.strstart+$.lookahead-MIN_MATCH,j=_tr_tally($,$.strstart-1-$.prev_match,$.prev_length-MIN_MATCH),$.lookahead-=$.prev_length-1,$.prev_length-=2;do++$.strstart<=O&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),D=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart);while(--$.prev_length!==0);if($.match_available=0,$.match_length=MIN_MATCH-1,$.strstart++,j&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}else if($.match_available){if(j=_tr_tally($,0,$.window[$.strstart-1]),j&&flush_block_only($,!1),$.strstart++,$.lookahead--,$.strm.avail_out===0)return BS_NEED_MORE}else $.match_available=1,$.strstart++,$.lookahead--}return $.match_available&&(j=_tr_tally($,0,$.window[$.strstart-1]),$.match_available=0),$.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,z===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=($,z)=>{let D,j,O,I;const o=$.window;for(;;){if($.lookahead<=MAX_MATCH){if(fill_window($),$.lookahead<=MAX_MATCH&&z===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=MIN_MATCH&&$.strstart>0&&(O=$.strstart-1,j=o[O],j===o[++O]&&j===o[++O]&&j===o[++O])){I=$.strstart+MAX_MATCH;do;while(j===o[++O]&&j===o[++O]&&j===o[++O]&&j===o[++O]&&j===o[++O]&&j===o[++O]&&j===o[++O]&&j===o[++O]&&O<I);$.match_length=MAX_MATCH-(I-O),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=MIN_MATCH?(D=_tr_tally($,1,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(D=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),D&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,z===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=($,z)=>{let D;for(;;){if($.lookahead===0&&(fill_window($),$.lookahead===0)){if(z===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if($.match_length=0,D=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,D&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,z===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config($,z,D,j,O){this.good_length=$,this.max_lazy=z,this.nice_length=D,this.max_chain=j,this.func=O}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=$=>{$.window_size=2*$.w_size,zero($.head),$.max_lazy_match=configuration_table[$.level].max_lazy,$.good_match=configuration_table[$.level].good_length,$.nice_match=configuration_table[$.level].nice_length,$.max_chain_length=configuration_table[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=MIN_MATCH-1,$.match_available=0,$.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateStateCheck=$=>{if(!$)return 1;const z=$.state;return!z||z.strm!==$||z.status!==INIT_STATE&&z.status!==GZIP_STATE&&z.status!==EXTRA_STATE&&z.status!==NAME_STATE&&z.status!==COMMENT_STATE&&z.status!==HCRC_STATE&&z.status!==BUSY_STATE&&z.status!==FINISH_STATE?1:0},deflateResetKeep=$=>{if(deflateStateCheck($))return err($,Z_STREAM_ERROR$2);$.total_in=$.total_out=0,$.data_type=Z_UNKNOWN;const z=$.state;return z.pending=0,z.pending_out=0,z.wrap<0&&(z.wrap=-z.wrap),z.status=z.wrap===2?GZIP_STATE:z.wrap?INIT_STATE:BUSY_STATE,$.adler=z.wrap===2?0:1,z.last_flush=-2,_tr_init(z),Z_OK$3},deflateReset=$=>{const z=deflateResetKeep($);return z===Z_OK$3&&lm_init($.state),z},deflateSetHeader=($,z)=>deflateStateCheck($)||$.state.wrap!==2?Z_STREAM_ERROR$2:($.state.gzhead=z,Z_OK$3),deflateInit2=($,z,D,j,O,I)=>{if(!$)return Z_STREAM_ERROR$2;let o=1;if(z===Z_DEFAULT_COMPRESSION$1&&(z=6),j<0?(o=0,j=-j):j>15&&(o=2,j-=16),O<1||O>MAX_MEM_LEVEL||D!==Z_DEFLATED$2||j<8||j>15||z<0||z>9||I<0||I>Z_FIXED||j===8&&o!==1)return err($,Z_STREAM_ERROR$2);j===8&&(j=9);const k=new DeflateState;return $.state=k,k.strm=$,k.status=INIT_STATE,k.wrap=o,k.gzhead=null,k.w_bits=j,k.w_size=1<<k.w_bits,k.w_mask=k.w_size-1,k.hash_bits=O+7,k.hash_size=1<<k.hash_bits,k.hash_mask=k.hash_size-1,k.hash_shift=~~((k.hash_bits+MIN_MATCH-1)/MIN_MATCH),k.window=new Uint8Array(k.w_size*2),k.head=new Uint16Array(k.hash_size),k.prev=new Uint16Array(k.w_size),k.lit_bufsize=1<<O+6,k.pending_buf_size=k.lit_bufsize*4,k.pending_buf=new Uint8Array(k.pending_buf_size),k.sym_buf=k.lit_bufsize,k.sym_end=(k.lit_bufsize-1)*3,k.level=z,k.strategy=I,k.method=D,deflateReset($)},deflateInit=($,z)=>deflateInit2($,z,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=($,z)=>{if(deflateStateCheck($)||z>Z_BLOCK$1||z<0)return $?err($,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const D=$.state;if(!$.output||$.avail_in!==0&&!$.input||D.status===FINISH_STATE&&z!==Z_FINISH$3)return err($,$.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const j=D.last_flush;if(D.last_flush=z,D.pending!==0){if(flush_pending($),$.avail_out===0)return D.last_flush=-1,Z_OK$3}else if($.avail_in===0&&rank(z)<=rank(j)&&z!==Z_FINISH$3)return err($,Z_BUF_ERROR$1);if(D.status===FINISH_STATE&&$.avail_in!==0)return err($,Z_BUF_ERROR$1);if(D.status===INIT_STATE&&D.wrap===0&&(D.status=BUSY_STATE),D.status===INIT_STATE){let O=Z_DEFLATED$2+(D.w_bits-8<<4)<<8,I=-1;if(D.strategy>=Z_HUFFMAN_ONLY||D.level<2?I=0:D.level<6?I=1:D.level===6?I=2:I=3,O|=I<<6,D.strstart!==0&&(O|=PRESET_DICT),O+=31-O%31,putShortMSB(D,O),D.strstart!==0&&(putShortMSB(D,$.adler>>>16),putShortMSB(D,$.adler&65535)),$.adler=1,D.status=BUSY_STATE,flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3}if(D.status===GZIP_STATE){if($.adler=0,put_byte(D,31),put_byte(D,139),put_byte(D,8),D.gzhead)put_byte(D,(D.gzhead.text?1:0)+(D.gzhead.hcrc?2:0)+(D.gzhead.extra?4:0)+(D.gzhead.name?8:0)+(D.gzhead.comment?16:0)),put_byte(D,D.gzhead.time&255),put_byte(D,D.gzhead.time>>8&255),put_byte(D,D.gzhead.time>>16&255),put_byte(D,D.gzhead.time>>24&255),put_byte(D,D.level===9?2:D.strategy>=Z_HUFFMAN_ONLY||D.level<2?4:0),put_byte(D,D.gzhead.os&255),D.gzhead.extra&&D.gzhead.extra.length&&(put_byte(D,D.gzhead.extra.length&255),put_byte(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&($.adler=crc32_1($.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=EXTRA_STATE;else if(put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,D.level===9?2:D.strategy>=Z_HUFFMAN_ONLY||D.level<2?4:0),put_byte(D,OS_CODE),D.status=BUSY_STATE,flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3}if(D.status===EXTRA_STATE){if(D.gzhead.extra){let O=D.pending,I=(D.gzhead.extra.length&65535)-D.gzindex;for(;D.pending+I>D.pending_buf_size;){let k=D.pending_buf_size-D.pending;if(D.pending_buf.set(D.gzhead.extra.subarray(D.gzindex,D.gzindex+k),D.pending),D.pending=D.pending_buf_size,D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O)),D.gzindex+=k,flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0,I-=k}let o=new Uint8Array(D.gzhead.extra);D.pending_buf.set(o.subarray(D.gzindex,D.gzindex+I),D.pending),D.pending+=I,D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O)),D.gzindex=0}D.status=NAME_STATE}if(D.status===NAME_STATE){if(D.gzhead.name){let O=D.pending,I;do{if(D.pending===D.pending_buf_size){if(D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O)),flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0}D.gzindex<D.gzhead.name.length?I=D.gzhead.name.charCodeAt(D.gzindex++)&255:I=0,put_byte(D,I)}while(I!==0);D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O)),D.gzindex=0}D.status=COMMENT_STATE}if(D.status===COMMENT_STATE){if(D.gzhead.comment){let O=D.pending,I;do{if(D.pending===D.pending_buf_size){if(D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O)),flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0}D.gzindex<D.gzhead.comment.length?I=D.gzhead.comment.charCodeAt(D.gzindex++)&255:I=0,put_byte(D,I)}while(I!==0);D.gzhead.hcrc&&D.pending>O&&($.adler=crc32_1($.adler,D.pending_buf,D.pending-O,O))}D.status=HCRC_STATE}if(D.status===HCRC_STATE){if(D.gzhead.hcrc){if(D.pending+2>D.pending_buf_size&&(flush_pending($),D.pending!==0))return D.last_flush=-1,Z_OK$3;put_byte(D,$.adler&255),put_byte(D,$.adler>>8&255),$.adler=0}if(D.status=BUSY_STATE,flush_pending($),D.pending!==0)return D.last_flush=-1,Z_OK$3}if($.avail_in!==0||D.lookahead!==0||z!==Z_NO_FLUSH$2&&D.status!==FINISH_STATE){let O=D.level===0?deflate_stored(D,z):D.strategy===Z_HUFFMAN_ONLY?deflate_huff(D,z):D.strategy===Z_RLE?deflate_rle(D,z):configuration_table[D.level].func(D,z);if((O===BS_FINISH_STARTED||O===BS_FINISH_DONE)&&(D.status=FINISH_STATE),O===BS_NEED_MORE||O===BS_FINISH_STARTED)return $.avail_out===0&&(D.last_flush=-1),Z_OK$3;if(O===BS_BLOCK_DONE&&(z===Z_PARTIAL_FLUSH?_tr_align(D):z!==Z_BLOCK$1&&(_tr_stored_block(D,0,0,!1),z===Z_FULL_FLUSH$1&&(zero(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),flush_pending($),$.avail_out===0))return D.last_flush=-1,Z_OK$3}return z!==Z_FINISH$3?Z_OK$3:D.wrap<=0?Z_STREAM_END$3:(D.wrap===2?(put_byte(D,$.adler&255),put_byte(D,$.adler>>8&255),put_byte(D,$.adler>>16&255),put_byte(D,$.adler>>24&255),put_byte(D,$.total_in&255),put_byte(D,$.total_in>>8&255),put_byte(D,$.total_in>>16&255),put_byte(D,$.total_in>>24&255)):(putShortMSB(D,$.adler>>>16),putShortMSB(D,$.adler&65535)),flush_pending($),D.wrap>0&&(D.wrap=-D.wrap),D.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=$=>{if(deflateStateCheck($))return Z_STREAM_ERROR$2;const z=$.state.status;return $.state=null,z===BUSY_STATE?err($,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=($,z)=>{let D=z.length;if(deflateStateCheck($))return Z_STREAM_ERROR$2;const j=$.state,O=j.wrap;if(O===2||O===1&&j.status!==INIT_STATE||j.lookahead)return Z_STREAM_ERROR$2;if(O===1&&($.adler=adler32_1($.adler,z,D,0)),j.wrap=0,D>=j.w_size){O===0&&(zero(j.head),j.strstart=0,j.block_start=0,j.insert=0);let N=new Uint8Array(j.w_size);N.set(z.subarray(D-j.w_size,D),0),z=N,D=j.w_size}const I=$.avail_in,o=$.next_in,k=$.input;for($.avail_in=D,$.next_in=0,$.input=z,fill_window(j);j.lookahead>=MIN_MATCH;){let N=j.strstart,F=j.lookahead-(MIN_MATCH-1);do j.ins_h=HASH(j,j.ins_h,j.window[N+MIN_MATCH-1]),j.prev[N&j.w_mask]=j.head[j.ins_h],j.head[j.ins_h]=N,N++;while(--F);j.strstart=N,j.lookahead=MIN_MATCH-1,fill_window(j)}return j.strstart+=j.lookahead,j.block_start=j.strstart,j.insert=j.lookahead,j.lookahead=0,j.match_length=j.prev_length=MIN_MATCH-1,j.match_available=0,$.next_in=o,$.input=k,$.avail_in=I,j.wrap=O,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=($,z)=>Object.prototype.hasOwnProperty.call($,z);var assign=function($){const z=Array.prototype.slice.call(arguments,1);for(;z.length;){const D=z.shift();if(D){if(typeof D!="object")throw new TypeError(D+"must be non-object");for(const j in D)_has(D,j)&&($[j]=D[j])}}return $},flattenChunks=$=>{let z=0;for(let j=0,O=$.length;j<O;j++)z+=$[j].length;const D=new Uint8Array(z);for(let j=0,O=0,I=$.length;j<I;j++){let o=$[j];D.set(o,O),O+=o.length}return D},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let $=0;$<256;$++)_utf8len[$]=$>=252?6:$>=248?5:$>=240?4:$>=224?3:$>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=$=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode($);let z,D,j,O,I,o=$.length,k=0;for(O=0;O<o;O++)D=$.charCodeAt(O),(D&64512)===55296&&O+1<o&&(j=$.charCodeAt(O+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),O++)),k+=D<128?1:D<2048?2:D<65536?3:4;for(z=new Uint8Array(k),I=0,O=0;I<k;O++)D=$.charCodeAt(O),(D&64512)===55296&&O+1<o&&(j=$.charCodeAt(O+1),(j&64512)===56320&&(D=65536+(D-55296<<10)+(j-56320),O++)),D<128?z[I++]=D:D<2048?(z[I++]=192|D>>>6,z[I++]=128|D&63):D<65536?(z[I++]=224|D>>>12,z[I++]=128|D>>>6&63,z[I++]=128|D&63):(z[I++]=240|D>>>18,z[I++]=128|D>>>12&63,z[I++]=128|D>>>6&63,z[I++]=128|D&63);return z};const buf2binstring=($,z)=>{if(z<65534&&$.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,$.length===z?$:$.subarray(0,z));let D="";for(let j=0;j<z;j++)D+=String.fromCharCode($[j]);return D};var buf2string=($,z)=>{const D=z||$.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode($.subarray(0,z));let j,O;const I=new Array(D*2);for(O=0,j=0;j<D;){let o=$[j++];if(o<128){I[O++]=o;continue}let k=_utf8len[o];if(k>4){I[O++]=65533,j+=k-1;continue}for(o&=k===2?31:k===3?15:7;k>1&&j<D;)o=o<<6|$[j++]&63,k--;if(k>1){I[O++]=65533;continue}o<65536?I[O++]=o:(o-=65536,I[O++]=55296|o>>10&1023,I[O++]=56320|o&1023)}return buf2binstring(I,O)},utf8border=($,z)=>{z=z||$.length,z>$.length&&(z=$.length);let D=z-1;for(;D>=0&&($[D]&192)===128;)D--;return D<0||D===0?z:D+_utf8len[$[D]]>z?D:z},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1($){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},$||{});let z=this.options;z.raw&&z.windowBits>0?z.windowBits=-z.windowBits:z.gzip&&z.windowBits>0&&z.windowBits<16&&(z.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let D=deflate_1$2.deflateInit2(this.strm,z.level,z.method,z.windowBits,z.memLevel,z.strategy);if(D!==Z_OK$2)throw new Error(messages[D]);if(z.header&&deflate_1$2.deflateSetHeader(this.strm,z.header),z.dictionary){let j;if(typeof z.dictionary=="string"?j=strings.string2buf(z.dictionary):toString$1.call(z.dictionary)==="[object ArrayBuffer]"?j=new Uint8Array(z.dictionary):j=z.dictionary,D=deflate_1$2.deflateSetDictionary(this.strm,j),D!==Z_OK$2)throw new Error(messages[D]);this._dict_set=!0}}Deflate$1.prototype.push=function($,z){const D=this.strm,j=this.options.chunkSize;let O,I;if(this.ended)return!1;for(z===~~z?I=z:I=z===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof $=="string"?D.input=strings.string2buf($):toString$1.call($)==="[object ArrayBuffer]"?D.input=new Uint8Array($):D.input=$,D.next_in=0,D.avail_in=D.input.length;;){if(D.avail_out===0&&(D.output=new Uint8Array(j),D.next_out=0,D.avail_out=j),(I===Z_SYNC_FLUSH||I===Z_FULL_FLUSH)&&D.avail_out<=6){this.onData(D.output.subarray(0,D.next_out)),D.avail_out=0;continue}if(O=deflate_1$2.deflate(D,I),O===Z_STREAM_END$2)return D.next_out>0&&this.onData(D.output.subarray(0,D.next_out)),O=deflate_1$2.deflateEnd(this.strm),this.onEnd(O),this.ended=!0,O===Z_OK$2;if(D.avail_out===0){this.onData(D.output);continue}if(I>0&&D.next_out>0){this.onData(D.output.subarray(0,D.next_out)),D.avail_out=0;continue}if(D.avail_in===0)break}return!0},Deflate$1.prototype.onData=function($){this.chunks.push($)},Deflate$1.prototype.onEnd=function($){$===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function deflate$1($,z){const D=new Deflate$1(z);if(D.push($,!0),D.err)throw D.msg||messages[D.err];return D.result}function deflateRaw$1($,z){return z=z||{},z.raw=!0,deflate$1($,z)}function gzip$1($,z){return z=z||{},z.gzip=!0,deflate$1($,z)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function $(z,D){let j,O,I,o,k,N,F,J,X,Y,Q,te,ie,ne,oe,ce,we,se,ye,fe,pe,ve,Te,me;const _e=z.state;j=z.next_in,Te=z.input,O=j+(z.avail_in-5),I=z.next_out,me=z.output,o=I-(D-z.avail_out),k=I+(z.avail_out-257),N=_e.dmax,F=_e.wsize,J=_e.whave,X=_e.wnext,Y=_e.window,Q=_e.hold,te=_e.bits,ie=_e.lencode,ne=_e.distcode,oe=(1<<_e.lenbits)-1,ce=(1<<_e.distbits)-1;e:do{te<15&&(Q+=Te[j++]<<te,te+=8,Q+=Te[j++]<<te,te+=8),we=ie[Q&oe];t:for(;;){if(se=we>>>24,Q>>>=se,te-=se,se=we>>>16&255,se===0)me[I++]=we&65535;else if(se&16){ye=we&65535,se&=15,se&&(te<se&&(Q+=Te[j++]<<te,te+=8),ye+=Q&(1<<se)-1,Q>>>=se,te-=se),te<15&&(Q+=Te[j++]<<te,te+=8,Q+=Te[j++]<<te,te+=8),we=ne[Q&ce];n:for(;;){if(se=we>>>24,Q>>>=se,te-=se,se=we>>>16&255,se&16){if(fe=we&65535,se&=15,te<se&&(Q+=Te[j++]<<te,te+=8,te<se&&(Q+=Te[j++]<<te,te+=8)),fe+=Q&(1<<se)-1,fe>N){z.msg="invalid distance too far back",_e.mode=BAD$1;break e}if(Q>>>=se,te-=se,se=I-o,fe>se){if(se=fe-se,se>J&&_e.sane){z.msg="invalid distance too far back",_e.mode=BAD$1;break e}if(pe=0,ve=Y,X===0){if(pe+=F-se,se<ye){ye-=se;do me[I++]=Y[pe++];while(--se);pe=I-fe,ve=me}}else if(X<se){if(pe+=F+X-se,se-=X,se<ye){ye-=se;do me[I++]=Y[pe++];while(--se);if(pe=0,X<ye){se=X,ye-=se;do me[I++]=Y[pe++];while(--se);pe=I-fe,ve=me}}}else if(pe+=X-se,se<ye){ye-=se;do me[I++]=Y[pe++];while(--se);pe=I-fe,ve=me}for(;ye>2;)me[I++]=ve[pe++],me[I++]=ve[pe++],me[I++]=ve[pe++],ye-=3;ye&&(me[I++]=ve[pe++],ye>1&&(me[I++]=ve[pe++]))}else{pe=I-fe;do me[I++]=me[pe++],me[I++]=me[pe++],me[I++]=me[pe++],ye-=3;while(ye>2);ye&&(me[I++]=me[pe++],ye>1&&(me[I++]=me[pe++]))}}else if((se&64)===0){we=ne[(we&65535)+(Q&(1<<se)-1)];continue n}else{z.msg="invalid distance code",_e.mode=BAD$1;break e}break}}else if((se&64)===0){we=ie[(we&65535)+(Q&(1<<se)-1)];continue t}else if(se&32){_e.mode=TYPE$1;break e}else{z.msg="invalid literal/length code",_e.mode=BAD$1;break e}break}}while(j<O&&I<k);ye=te>>3,j-=ye,te-=ye<<3,Q&=(1<<te)-1,z.next_in=j,z.next_out=I,z.avail_in=j<O?5+(O-j):5-(j-O),z.avail_out=I<k?257+(k-I):257-(I-k),_e.hold=Q,_e.bits=te};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=($,z,D,j,O,I,o,k)=>{const N=k.bits;let F=0,J=0,X=0,Y=0,Q=0,te=0,ie=0,ne=0,oe=0,ce=0,we,se,ye,fe,pe,ve=null,Te;const me=new Uint16Array(MAXBITS+1),_e=new Uint16Array(MAXBITS+1);let De=null,je,Fe,qe;for(F=0;F<=MAXBITS;F++)me[F]=0;for(J=0;J<j;J++)me[z[D+J]]++;for(Q=N,Y=MAXBITS;Y>=1&&me[Y]===0;Y--);if(Q>Y&&(Q=Y),Y===0)return O[I++]=1<<24|64<<16|0,O[I++]=1<<24|64<<16|0,k.bits=1,0;for(X=1;X<Y&&me[X]===0;X++);for(Q<X&&(Q=X),ne=1,F=1;F<=MAXBITS;F++)if(ne<<=1,ne-=me[F],ne<0)return-1;if(ne>0&&($===CODES$1||Y!==1))return-1;for(_e[1]=0,F=1;F<MAXBITS;F++)_e[F+1]=_e[F]+me[F];for(J=0;J<j;J++)z[D+J]!==0&&(o[_e[z[D+J]]++]=J);if($===CODES$1?(ve=De=o,Te=20):$===LENS$1?(ve=lbase,De=lext,Te=257):(ve=dbase,De=dext,Te=0),ce=0,J=0,F=X,pe=I,te=Q,ie=0,ye=-1,oe=1<<Q,fe=oe-1,$===LENS$1&&oe>ENOUGH_LENS$1||$===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;for(;;){je=F-ie,o[J]+1<Te?(Fe=0,qe=o[J]):o[J]>=Te?(Fe=De[o[J]-Te],qe=ve[o[J]-Te]):(Fe=96,qe=0),we=1<<F-ie,se=1<<te,X=se;do se-=we,O[pe+(ce>>ie)+se]=je<<24|Fe<<16|qe|0;while(se!==0);for(we=1<<F-1;ce&we;)we>>=1;if(we!==0?(ce&=we-1,ce+=we):ce=0,J++,--me[F]===0){if(F===Y)break;F=z[D+o[J]]}if(F>Q&&(ce&fe)!==ye){for(ie===0&&(ie=Q),pe+=X,te=F-ie,ne=1<<te;te+ie<Y&&(ne-=me[te+ie],!(ne<=0));)te++,ne<<=1;if(oe+=1<<te,$===LENS$1&&oe>ENOUGH_LENS$1||$===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;ye=ce&fe,O[ye]=Q<<24|te<<16|pe-I|0}}return ce!==0&&(O[pe+ce]=F-ie<<24|64<<16|0),k.bits=Q,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=$=>($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=$=>{if(!$)return 1;const z=$.state;return!z||z.strm!==$||z.mode<HEAD||z.mode>SYNC?1:0},inflateResetKeep=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const z=$.state;return $.total_in=$.total_out=z.total=0,$.msg="",z.wrap&&($.adler=z.wrap&1),z.mode=HEAD,z.last=0,z.havedict=0,z.flags=-1,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new Int32Array(ENOUGH_LENS),z.distcode=z.distdyn=new Int32Array(ENOUGH_DISTS),z.sane=1,z.back=-1,Z_OK$1},inflateReset=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const z=$.state;return z.wsize=0,z.whave=0,z.wnext=0,inflateResetKeep($)},inflateReset2=($,z)=>{let D;if(inflateStateCheck($))return Z_STREAM_ERROR$1;const j=$.state;return z<0?(D=0,z=-z):(D=(z>>4)+5,z<48&&(z&=15)),z&&(z<8||z>15)?Z_STREAM_ERROR$1:(j.window!==null&&j.wbits!==z&&(j.window=null),j.wrap=D,j.wbits=z,inflateReset($))},inflateInit2=($,z)=>{if(!$)return Z_STREAM_ERROR$1;const D=new InflateState;$.state=D,D.strm=$,D.window=null,D.mode=HEAD;const j=inflateReset2($,z);return j!==Z_OK$1&&($.state=null),j},inflateInit=$=>inflateInit2($,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=$=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let z=0;for(;z<144;)$.lens[z++]=8;for(;z<256;)$.lens[z++]=9;for(;z<280;)$.lens[z++]=7;for(;z<288;)$.lens[z++]=8;for(inftrees(LENS,$.lens,0,288,lenfix,0,$.work,{bits:9}),z=0;z<32;)$.lens[z++]=5;inftrees(DISTS,$.lens,0,32,distfix,0,$.work,{bits:5}),virgin=!1}$.lencode=lenfix,$.lenbits=9,$.distcode=distfix,$.distbits=5},updatewindow=($,z,D,j)=>{let O;const I=$.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new Uint8Array(I.wsize)),j>=I.wsize?(I.window.set(z.subarray(D-I.wsize,D),0),I.wnext=0,I.whave=I.wsize):(O=I.wsize-I.wnext,O>j&&(O=j),I.window.set(z.subarray(D-j,D-j+O),I.wnext),j-=O,j?(I.window.set(z.subarray(D-j,D),0),I.wnext=j,I.whave=I.wsize):(I.wnext+=O,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=O))),0},inflate$2=($,z)=>{let D,j,O,I,o,k,N,F,J,X,Y,Q,te,ie,ne=0,oe,ce,we,se,ye,fe,pe,ve;const Te=new Uint8Array(4);let me,_e;const De=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck($)||!$.output||!$.input&&$.avail_in!==0)return Z_STREAM_ERROR$1;D=$.state,D.mode===TYPE&&(D.mode=TYPEDO),o=$.next_out,O=$.output,N=$.avail_out,I=$.next_in,j=$.input,k=$.avail_in,F=D.hold,J=D.bits,X=k,Y=N,ve=Z_OK$1;e:for(;;)switch(D.mode){case HEAD:if(D.wrap===0){D.mode=TYPEDO;break}for(;J<16;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(D.wrap&2&&F===35615){D.wbits===0&&(D.wbits=15),D.check=0,Te[0]=F&255,Te[1]=F>>>8&255,D.check=crc32_1(D.check,Te,2,0),F=0,J=0,D.mode=FLAGS;break}if(D.head&&(D.head.done=!1),!(D.wrap&1)||(((F&255)<<8)+(F>>8))%31){$.msg="incorrect header check",D.mode=BAD;break}if((F&15)!==Z_DEFLATED){$.msg="unknown compression method",D.mode=BAD;break}if(F>>>=4,J-=4,pe=(F&15)+8,D.wbits===0&&(D.wbits=pe),pe>15||pe>D.wbits){$.msg="invalid window size",D.mode=BAD;break}D.dmax=1<<D.wbits,D.flags=0,$.adler=D.check=1,D.mode=F&512?DICTID:TYPE,F=0,J=0;break;case FLAGS:for(;J<16;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(D.flags=F,(D.flags&255)!==Z_DEFLATED){$.msg="unknown compression method",D.mode=BAD;break}if(D.flags&57344){$.msg="unknown header flags set",D.mode=BAD;break}D.head&&(D.head.text=F>>8&1),D.flags&512&&D.wrap&4&&(Te[0]=F&255,Te[1]=F>>>8&255,D.check=crc32_1(D.check,Te,2,0)),F=0,J=0,D.mode=TIME;case TIME:for(;J<32;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.head&&(D.head.time=F),D.flags&512&&D.wrap&4&&(Te[0]=F&255,Te[1]=F>>>8&255,Te[2]=F>>>16&255,Te[3]=F>>>24&255,D.check=crc32_1(D.check,Te,4,0)),F=0,J=0,D.mode=OS;case OS:for(;J<16;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.head&&(D.head.xflags=F&255,D.head.os=F>>8),D.flags&512&&D.wrap&4&&(Te[0]=F&255,Te[1]=F>>>8&255,D.check=crc32_1(D.check,Te,2,0)),F=0,J=0,D.mode=EXLEN;case EXLEN:if(D.flags&1024){for(;J<16;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.length=F,D.head&&(D.head.extra_len=F),D.flags&512&&D.wrap&4&&(Te[0]=F&255,Te[1]=F>>>8&255,D.check=crc32_1(D.check,Te,2,0)),F=0,J=0}else D.head&&(D.head.extra=null);D.mode=EXTRA;case EXTRA:if(D.flags&1024&&(Q=D.length,Q>k&&(Q=k),Q&&(D.head&&(pe=D.head.extra_len-D.length,D.head.extra||(D.head.extra=new Uint8Array(D.head.extra_len)),D.head.extra.set(j.subarray(I,I+Q),pe)),D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,j,Q,I)),k-=Q,I+=Q,D.length-=Q),D.length))break e;D.length=0,D.mode=NAME;case NAME:if(D.flags&2048){if(k===0)break e;Q=0;do pe=j[I+Q++],D.head&&pe&&D.length<65536&&(D.head.name+=String.fromCharCode(pe));while(pe&&Q<k);if(D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,j,Q,I)),k-=Q,I+=Q,pe)break e}else D.head&&(D.head.name=null);D.length=0,D.mode=COMMENT;case COMMENT:if(D.flags&4096){if(k===0)break e;Q=0;do pe=j[I+Q++],D.head&&pe&&D.length<65536&&(D.head.comment+=String.fromCharCode(pe));while(pe&&Q<k);if(D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,j,Q,I)),k-=Q,I+=Q,pe)break e}else D.head&&(D.head.comment=null);D.mode=HCRC;case HCRC:if(D.flags&512){for(;J<16;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(D.wrap&4&&F!==(D.check&65535)){$.msg="header crc mismatch",D.mode=BAD;break}F=0,J=0}D.head&&(D.head.hcrc=D.flags>>9&1,D.head.done=!0),$.adler=D.check=0,D.mode=TYPE;break;case DICTID:for(;J<32;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}$.adler=D.check=zswap32(F),F=0,J=0,D.mode=DICT;case DICT:if(D.havedict===0)return $.next_out=o,$.avail_out=N,$.next_in=I,$.avail_in=k,D.hold=F,D.bits=J,Z_NEED_DICT$1;$.adler=D.check=1,D.mode=TYPE;case TYPE:if(z===Z_BLOCK||z===Z_TREES)break e;case TYPEDO:if(D.last){F>>>=J&7,J-=J&7,D.mode=CHECK;break}for(;J<3;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}switch(D.last=F&1,F>>>=1,J-=1,F&3){case 0:D.mode=STORED;break;case 1:if(fixedtables(D),D.mode=LEN_,z===Z_TREES){F>>>=2,J-=2;break e}break;case 2:D.mode=TABLE;break;case 3:$.msg="invalid block type",D.mode=BAD}F>>>=2,J-=2;break;case STORED:for(F>>>=J&7,J-=J&7;J<32;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if((F&65535)!==(F>>>16^65535)){$.msg="invalid stored block lengths",D.mode=BAD;break}if(D.length=F&65535,F=0,J=0,D.mode=COPY_,z===Z_TREES)break e;case COPY_:D.mode=COPY;case COPY:if(Q=D.length,Q){if(Q>k&&(Q=k),Q>N&&(Q=N),Q===0)break e;O.set(j.subarray(I,I+Q),o),k-=Q,I+=Q,N-=Q,o+=Q,D.length-=Q;break}D.mode=TYPE;break;case TABLE:for(;J<14;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(D.nlen=(F&31)+257,F>>>=5,J-=5,D.ndist=(F&31)+1,F>>>=5,J-=5,D.ncode=(F&15)+4,F>>>=4,J-=4,D.nlen>286||D.ndist>30){$.msg="too many length or distance symbols",D.mode=BAD;break}D.have=0,D.mode=LENLENS;case LENLENS:for(;D.have<D.ncode;){for(;J<3;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.lens[De[D.have++]]=F&7,F>>>=3,J-=3}for(;D.have<19;)D.lens[De[D.have++]]=0;if(D.lencode=D.lendyn,D.lenbits=7,me={bits:D.lenbits},ve=inftrees(CODES,D.lens,0,19,D.lencode,0,D.work,me),D.lenbits=me.bits,ve){$.msg="invalid code lengths set",D.mode=BAD;break}D.have=0,D.mode=CODELENS;case CODELENS:for(;D.have<D.nlen+D.ndist;){for(;ne=D.lencode[F&(1<<D.lenbits)-1],oe=ne>>>24,ce=ne>>>16&255,we=ne&65535,!(oe<=J);){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(we<16)F>>>=oe,J-=oe,D.lens[D.have++]=we;else{if(we===16){for(_e=oe+2;J<_e;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(F>>>=oe,J-=oe,D.have===0){$.msg="invalid bit length repeat",D.mode=BAD;break}pe=D.lens[D.have-1],Q=3+(F&3),F>>>=2,J-=2}else if(we===17){for(_e=oe+3;J<_e;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}F>>>=oe,J-=oe,pe=0,Q=3+(F&7),F>>>=3,J-=3}else{for(_e=oe+7;J<_e;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}F>>>=oe,J-=oe,pe=0,Q=11+(F&127),F>>>=7,J-=7}if(D.have+Q>D.nlen+D.ndist){$.msg="invalid bit length repeat",D.mode=BAD;break}for(;Q--;)D.lens[D.have++]=pe}}if(D.mode===BAD)break;if(D.lens[256]===0){$.msg="invalid code -- missing end-of-block",D.mode=BAD;break}if(D.lenbits=9,me={bits:D.lenbits},ve=inftrees(LENS,D.lens,0,D.nlen,D.lencode,0,D.work,me),D.lenbits=me.bits,ve){$.msg="invalid literal/lengths set",D.mode=BAD;break}if(D.distbits=6,D.distcode=D.distdyn,me={bits:D.distbits},ve=inftrees(DISTS,D.lens,D.nlen,D.ndist,D.distcode,0,D.work,me),D.distbits=me.bits,ve){$.msg="invalid distances set",D.mode=BAD;break}if(D.mode=LEN_,z===Z_TREES)break e;case LEN_:D.mode=LEN;case LEN:if(k>=6&&N>=258){$.next_out=o,$.avail_out=N,$.next_in=I,$.avail_in=k,D.hold=F,D.bits=J,inffast($,Y),o=$.next_out,O=$.output,N=$.avail_out,I=$.next_in,j=$.input,k=$.avail_in,F=D.hold,J=D.bits,D.mode===TYPE&&(D.back=-1);break}for(D.back=0;ne=D.lencode[F&(1<<D.lenbits)-1],oe=ne>>>24,ce=ne>>>16&255,we=ne&65535,!(oe<=J);){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(ce&&(ce&240)===0){for(se=oe,ye=ce,fe=we;ne=D.lencode[fe+((F&(1<<se+ye)-1)>>se)],oe=ne>>>24,ce=ne>>>16&255,we=ne&65535,!(se+oe<=J);){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}F>>>=se,J-=se,D.back+=se}if(F>>>=oe,J-=oe,D.back+=oe,D.length=we,ce===0){D.mode=LIT;break}if(ce&32){D.back=-1,D.mode=TYPE;break}if(ce&64){$.msg="invalid literal/length code",D.mode=BAD;break}D.extra=ce&15,D.mode=LENEXT;case LENEXT:if(D.extra){for(_e=D.extra;J<_e;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.length+=F&(1<<D.extra)-1,F>>>=D.extra,J-=D.extra,D.back+=D.extra}D.was=D.length,D.mode=DIST;case DIST:for(;ne=D.distcode[F&(1<<D.distbits)-1],oe=ne>>>24,ce=ne>>>16&255,we=ne&65535,!(oe<=J);){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if((ce&240)===0){for(se=oe,ye=ce,fe=we;ne=D.distcode[fe+((F&(1<<se+ye)-1)>>se)],oe=ne>>>24,ce=ne>>>16&255,we=ne&65535,!(se+oe<=J);){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}F>>>=se,J-=se,D.back+=se}if(F>>>=oe,J-=oe,D.back+=oe,ce&64){$.msg="invalid distance code",D.mode=BAD;break}D.offset=we,D.extra=ce&15,D.mode=DISTEXT;case DISTEXT:if(D.extra){for(_e=D.extra;J<_e;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}D.offset+=F&(1<<D.extra)-1,F>>>=D.extra,J-=D.extra,D.back+=D.extra}if(D.offset>D.dmax){$.msg="invalid distance too far back",D.mode=BAD;break}D.mode=MATCH;case MATCH:if(N===0)break e;if(Q=Y-N,D.offset>Q){if(Q=D.offset-Q,Q>D.whave&&D.sane){$.msg="invalid distance too far back",D.mode=BAD;break}Q>D.wnext?(Q-=D.wnext,te=D.wsize-Q):te=D.wnext-Q,Q>D.length&&(Q=D.length),ie=D.window}else ie=O,te=o-D.offset,Q=D.length;Q>N&&(Q=N),N-=Q,D.length-=Q;do O[o++]=ie[te++];while(--Q);D.length===0&&(D.mode=LEN);break;case LIT:if(N===0)break e;O[o++]=D.length,N--,D.mode=LEN;break;case CHECK:if(D.wrap){for(;J<32;){if(k===0)break e;k--,F|=j[I++]<<J,J+=8}if(Y-=N,$.total_out+=Y,D.total+=Y,D.wrap&4&&Y&&($.adler=D.check=D.flags?crc32_1(D.check,O,Y,o-Y):adler32_1(D.check,O,Y,o-Y)),Y=N,D.wrap&4&&(D.flags?F:zswap32(F))!==D.check){$.msg="incorrect data check",D.mode=BAD;break}F=0,J=0}D.mode=LENGTH;case LENGTH:if(D.wrap&&D.flags){for(;J<32;){if(k===0)break e;k--,F+=j[I++]<<J,J+=8}if(D.wrap&4&&F!==(D.total&4294967295)){$.msg="incorrect length check",D.mode=BAD;break}F=0,J=0}D.mode=DONE;case DONE:ve=Z_STREAM_END$1;break e;case BAD:ve=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return $.next_out=o,$.avail_out=N,$.next_in=I,$.avail_in=k,D.hold=F,D.bits=J,(D.wsize||Y!==$.avail_out&&D.mode<BAD&&(D.mode<CHECK||z!==Z_FINISH$1))&&updatewindow($,$.output,$.next_out,Y-$.avail_out),X-=$.avail_in,Y-=$.avail_out,$.total_in+=X,$.total_out+=Y,D.total+=Y,D.wrap&4&&Y&&($.adler=D.check=D.flags?crc32_1(D.check,O,Y,$.next_out-Y):adler32_1(D.check,O,Y,$.next_out-Y)),$.data_type=D.bits+(D.last?64:0)+(D.mode===TYPE?128:0)+(D.mode===LEN_||D.mode===COPY_?256:0),(X===0&&Y===0||z===Z_FINISH$1)&&ve===Z_OK$1&&(ve=Z_BUF_ERROR),ve},inflateEnd=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;let z=$.state;return z.window&&(z.window=null),$.state=null,Z_OK$1},inflateGetHeader=($,z)=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const D=$.state;return(D.wrap&2)===0?Z_STREAM_ERROR$1:(D.head=z,z.done=!1,Z_OK$1)},inflateSetDictionary=($,z)=>{const D=z.length;let j,O,I;return inflateStateCheck($)||(j=$.state,j.wrap!==0&&j.mode!==DICT)?Z_STREAM_ERROR$1:j.mode===DICT&&(O=1,O=adler32_1(O,z,D,0),O!==j.check)?Z_DATA_ERROR$1:(I=updatewindow($,z,D,D),I?(j.mode=MEM,Z_MEM_ERROR$1):(j.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1($){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},$||{});const z=this.options;z.raw&&z.windowBits>=0&&z.windowBits<16&&(z.windowBits=-z.windowBits,z.windowBits===0&&(z.windowBits=-15)),z.windowBits>=0&&z.windowBits<16&&!($&&$.windowBits)&&(z.windowBits+=32),z.windowBits>15&&z.windowBits<48&&(z.windowBits&15)===0&&(z.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let D=inflate_1$2.inflateInit2(this.strm,z.windowBits);if(D!==Z_OK)throw new Error(messages[D]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),z.dictionary&&(typeof z.dictionary=="string"?z.dictionary=strings.string2buf(z.dictionary):toString.call(z.dictionary)==="[object ArrayBuffer]"&&(z.dictionary=new Uint8Array(z.dictionary)),z.raw&&(D=inflate_1$2.inflateSetDictionary(this.strm,z.dictionary),D!==Z_OK)))throw new Error(messages[D])}Inflate$1.prototype.push=function($,z){const D=this.strm,j=this.options.chunkSize,O=this.options.dictionary;let I,o,k;if(this.ended)return!1;for(z===~~z?o=z:o=z===!0?Z_FINISH:Z_NO_FLUSH,toString.call($)==="[object ArrayBuffer]"?D.input=new Uint8Array($):D.input=$,D.next_in=0,D.avail_in=D.input.length;;){for(D.avail_out===0&&(D.output=new Uint8Array(j),D.next_out=0,D.avail_out=j),I=inflate_1$2.inflate(D,o),I===Z_NEED_DICT&&O&&(I=inflate_1$2.inflateSetDictionary(D,O),I===Z_OK?I=inflate_1$2.inflate(D,o):I===Z_DATA_ERROR&&(I=Z_NEED_DICT));D.avail_in>0&&I===Z_STREAM_END&&D.state.wrap>0&&$[D.next_in]!==0;)inflate_1$2.inflateReset(D),I=inflate_1$2.inflate(D,o);switch(I){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(I),this.ended=!0,!1}if(k=D.avail_out,D.next_out&&(D.avail_out===0||I===Z_STREAM_END))if(this.options.to==="string"){let N=strings.utf8border(D.output,D.next_out),F=D.next_out-N,J=strings.buf2string(D.output,N);D.next_out=F,D.avail_out=j-F,F&&D.output.set(D.output.subarray(N,N+F),0),this.onData(J)}else this.onData(D.output.length===D.next_out?D.output:D.output.subarray(0,D.next_out));if(!(I===Z_OK&&k===0)){if(I===Z_STREAM_END)return I=inflate_1$2.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,!0;if(D.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function($){this.chunks.push($)},Inflate$1.prototype.onEnd=function($){$===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function inflate$1($,z){const D=new Inflate$1(z);if(D.push($),D.err)throw D.msg||messages[D.err];return D.result}function inflateRaw$1($,z){return z=z||{},z.raw=!0,inflate$1($,z)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const ignoreEvent=["updateSeverTime"];ignoreEvent.push("heartbeat"),ignoreEvent.push("heartbeatEx"),ignoreEvent.push("networkQualityChange"),ignoreEvent.push("onNetQuality"),ignoreEvent.push("updateCall"),ignoreEvent.push("pubNotify");const compressArrayBuffer=$=>{const z=new Uint8Array($),D=pako.deflate(z,{gzip:!0});return new Uint8Array(D==null?void 0:D.buffer)},decompressArrayBuffer=$=>{const z=new Uint8Array($),D=pako.inflate(z,{gzip:!0});return new Uint8Array(D==null?void 0:D.buffer)},sendMessageFormat=$=>{const{event:z}=$;switch($.data_original=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),z){case"login":$.data=com.quick.voice.proto.Login.encode($.data).finish();break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinReq.encode($.data).finish();break;case"quitRoom":$.data=com.quick.voice.proto.QuitReq.encode($.data).finish();break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"publish":$.data=com.quick.voice.proto.PublishReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishReq.encode($.data).finish();break;case"subscribe":$.data=com.quick.voice.proto.SubscribeReq.encode($.data).finish();break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.encode($.data).finish();break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"renegotiate":$.data=com.quick.voice.proto.RenegotiateReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoReq.encode($.data).finish();break;case"updateCall":$.data=com.quick.voice.proto.UpdateCall.encode($.data).finish();break;case"networkQualityChange":$.data=com.quick.voice.proto.NetQualityChange.encode($.data).finish();break;case"pubNotify":$.data=com.quick.voice.proto.PublishNotify.encode($.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode($.data).finish();break;default:$.data=new Uint8Array;break}return $},onMessageFormat=$=>{const{event:z,compress:D=!1}=$;if($.data_remote=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),D)try{$.data=decompressArrayBuffer($.data)}catch(j){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",j)}switch(z){case"login":$.data=com.quick.voice.proto.Login.decode($.data);break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinRsp.decode($.data);break;case"onJoinRoom":$.data=com.quick.voice.proto.JoinNotify.decode($.data);break;case"onQuitRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFRsp.decode($.data);break;case"publish":$.data=com.quick.voice.proto.PublishRsp.decode($.data);break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishRsq.decode($.data);break;case"onPublish":$.data=com.quick.voice.proto.PublishNotify.decode($.data);break;case"subscribe":$.data=com.quick.voice.proto.SubscribeRsp.decode($.data);break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.decode($.data);break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackRsp.decode($.data);break;case"onCloseTrack":$.data=com.quick.voice.proto.CloseTrackNotify.decode($.data);break;case"onUpdateCall":$.data=com.quick.voice.proto.UpdateCall.decode($.data);break;case"onDataChannelPublish":$.data=com.quick.voice.proto.UserChannel.decode($.data);break;case"onDestroyRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"onUpdatePermissions":$.data=com.quick.voice.proto.UpdatePermissions.decode($.data);break;case"onNetQuality":$.data=com.quick.voice.proto.NetQualityNotify.decode($.data);break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoRsp.decode($.data);break;case"onCDNPlayUrlAdd":$.data=com.quick.voice.proto.CDNPlayAddressNotify.decode($.data);break;case"onUpdateBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode($.data);break;case"debugger":$.data=JSON.parse(new TextDecoder().decode($.data));break}return $};class CallsWebSocket{constructor(z){Xe(this,mt);Xe(this,ct,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:30*1e3});Xe(this,Bt,"");Xe(this,Ft,{});Xe(this,Gt,{});Se(this,"state","closed");Se(this,"sendMessageBefore",async()=>{});Se(this,"onReconnectSuccess",z=>{});Se(this,"onReconnectStop",z=>{});Xe(this,$n,z=>{let D=!0;const{code:j=1e3}=z;return(j===1e3||j===4e3)&&(D=!1),this.state="connecting",D});Xe(this,Dn,async z=>{Re(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",z),this.state="connected",this.onReconnectSuccess(z)});Xe(this,Bn,async z=>{Re(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",z),this.onReconnectStop(z)});Xe(this,Sn,(z,D={})=>{try{const{time:j,event:O,data:I={},data_original:o={},data_remote:k,...N}=D,F=E(j,"YYYY-MM-DD hh:mm:ss",{offset:480});let J={};const X=(we={})=>{const se=JSON.parse(JSON.stringify(we)),ye=Object.keys(se);for(const fe of ye)(fe.includes("sdp")||fe.includes("Sdp"))&&(se[fe]="");return se};let Y="res ↓";switch(z){case"res":Y="res ↓",J=X(I);break;case"req":Y="req ↑",J=X(o);break}let Q="#quickvo.logs";ignoreEvent.includes(O)&&(Q="#quickvo.ignoreEvents");const te={"#action":Y,timeStr:F,event:O,data:J,time:j,...N},ie=localStorage.getItem(Q)||JSON.stringify([]),ne=JSON.parse(ie);let oe=O==="heartbeat"||O==="heartbeatEx";const ce=[te];for(const we of ne){const{event:se}=we;if(se==="heartbeat"||se==="heartbeatEx"){if(oe)continue;oe=!0}if(ce.length===200)break;ce.push(we)}localStorage.setItem(Q,JSON.stringify(ce))}catch(j){Re(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",j)}});Xe(this,Nn,(z,{resolve:D,reject:j})=>{const{sn:O=""}=z,I=()=>{const k=Re(this,Ft)[O];clearTimeout(k.destructionTimer),delete Re(this,Ft)[O]},o=window.setTimeout(()=>{const k=Re(this,Ft)[O];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",k.message),I(),j("event is timeout")},Re(this,ct).timeout);Re(this,Ft)[O]={message:z,resolve:D,reject:j,destruction:I,destructionTimer:o}});Xe(this,Mn,z=>Re(this,Ft)[z]);Xe(this,qn,async z=>{const D=new Uint8Array(z),j=com.quick.voice.proto.CommonRsp.decode(D),{sn:O,event:I}=j,o=onMessageFormat(j);if(Re(this,ct).debug&&!ignoreEvent.includes(I)&&(Re(this,Sn).call(this,"res",o),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",o)),notifyName_keys.includes(I))return this.emitNotify(I,P$1(o,["code","data","desc"]));const N=Re(this,Mn).call(this,O);if(N){const{resolve:F=X=>{},destruction:J=()=>{}}=N;F(P$1(o,["code","data","desc"])),J()}});Se(this,"clearEvents",(z=[])=>{const D=Object.keys(Re(this,Ft));z.length===0&&(z=D);for(const j of D){if(!z.includes(j))continue;const O=Re(this,Ft)[j];if(O){const{destruction:I}=O;I()}}});Se(this,"connect",async(z="")=>new Promise(async D=>{z&&Et(this,Bt,z),Re(this,mt)&&(await Re(this,mt).close(),this.state="closed");const j=`${Re(this,ct).url}?s=${Re(this,Bt)}&t=${Date.now()}`,O=new Date().getTime();if(Et(this,mt,new M({...Re(this,ct),debug:!0,url:j,binaryType:"arraybuffer",onMessage:Re(this,qn),checkReconnect:Re(this,$n),getHeartbeatMsg:()=>"",onReconnectSuccess:Re(this,Dn),onReconnectStop:Re(this,Bn)})),this.state="connecting",await Re(this,mt).connect(),this.state="connected",Re(this,ct).debug){const o=new Date().getTime()-O;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${o}ms-广播事件`,Re(this,Gt))}D(Re(this,mt))}));Se(this,"close",async()=>{var D;Re(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const z=Object.keys(Re(this,Ft));for(const j of z){const{destructionTimer:O}=Re(this,Ft)[j];clearTimeout(O)}Et(this,Ft,{}),await((D=Re(this,mt))==null?void 0:D.close()),this.state="closed"});Se(this,"sendMessage",(z,D=!0)=>new Promise(async(j,O)=>{var J;await this.sendMessageBefore();const{event:I,...o}=z,k=Date.now(),N=sendMessageFormat({event:I,sn:+`${k}${v$1(1e3,9999)}`,time:k,valid:Re(this,ct).timeout,version:1,compress:!1,...o});Re(this,ct).debug&&!ignoreEvent.includes(I)&&(Re(this,Sn).call(this,"req",N),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",N)),D&&Re(this,Nn).call(this,N,{resolve:j,reject:O});const F=com.quick.voice.proto.CommonReq.encode(N).finish();(J=Re(this,mt))==null||J.sendMessage(F)}));Se(this,"emitNotify",async(z,D)=>{const j=Re(this,Gt)[z]||[];for(const O of j){const{callback:I=async()=>{}}=O;await I(D)}});Se(this,"addNotify",(z,D=!1)=>{const{event:j,sn:O=xt(32)}=z;Re(this,Gt)[j]||(Re(this,Gt)[j]=[]);const I=Re(this,Gt)[j],o=I.findIndex(k=>k.sn===O);return o!==-1&&I.splice(o,1),D?I.unshift(z):I.push(z),O});Se(this,"removeNotify",(z=[])=>{if(z.length===0)Et(this,Gt,{});else{const D=Object.keys(Re(this,Gt));for(const j of D)Re(this,Gt)[j]=Re(this,Gt)[j].filter(O=>!z.includes(O.sn||""))}Re(this,ct).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",Re(this,Gt))});Et(this,ct,{...Re(this,ct),...z})}}mt=new WeakMap,ct=new WeakMap,Bt=new WeakMap,Ft=new WeakMap,Gt=new WeakMap,$n=new WeakMap,Dn=new WeakMap,Bn=new WeakMap,Sn=new WeakMap,Nn=new WeakMap,Mn=new WeakMap,qn=new WeakMap;/*! For license information please see pikazLocationModule.js.LICENSE.txt */var e$2={782:function($){$.exports=(()=>{var z={483:(O,I,o)=>{O.exports=function k(N,F,J){function X(te,ie){if(!F[te]){if(!N[te]){if(Y)return Y(te,!0);var ne=new Error("Cannot find module '"+te+"'");throw ne.code="MODULE_NOT_FOUND",ne}var oe=F[te]={exports:{}};N[te][0].call(oe.exports,function(ce){return X(N[te][1][ce]||ce)},oe,oe.exports,k,N,F,J)}return F[te].exports}for(var Y=void 0,Q=0;Q<J.length;Q++)X(J[Q]);return X}({1:[function(k,N,F){(function(J){var X,Y,Q=J.MutationObserver||J.WebKitMutationObserver;if(Q){var te=0,ie=new Q(we),ne=J.document.createTextNode("");ie.observe(ne,{characterData:!0}),X=function(){ne.data=te=++te%2}}else if(J.setImmediate||J.MessageChannel===void 0)X="document"in J&&"onreadystatechange"in J.document.createElement("script")?function(){var se=J.document.createElement("script");se.onreadystatechange=function(){we(),se.onreadystatechange=null,se.parentNode.removeChild(se),se=null},J.document.documentElement.appendChild(se)}:function(){setTimeout(we,0)};else{var oe=new J.MessageChannel;oe.port1.onmessage=we,X=function(){oe.port2.postMessage(0)}}var ce=[];function we(){var se,ye;Y=!0;for(var fe=ce.length;fe;){for(ye=ce,ce=[],se=-1;++se<fe;)ye[se]();fe=ce.length}Y=!1}N.exports=function(se){ce.push(se)!==1||Y||X()}}).call(this,o.g!==void 0?o.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(k,N,F){var J=k(1);function X(){}var Y={},Q=["REJECTED"],te=["FULFILLED"],ie=["PENDING"];function ne(fe){if(typeof fe!="function")throw new TypeError("resolver must be a function");this.state=ie,this.queue=[],this.outcome=void 0,fe!==X&&se(this,fe)}function oe(fe,pe,ve){this.promise=fe,typeof pe=="function"&&(this.onFulfilled=pe,this.callFulfilled=this.otherCallFulfilled),typeof ve=="function"&&(this.onRejected=ve,this.callRejected=this.otherCallRejected)}function ce(fe,pe,ve){J(function(){var Te;try{Te=pe(ve)}catch(me){return Y.reject(fe,me)}Te===fe?Y.reject(fe,new TypeError("Cannot resolve promise with itself")):Y.resolve(fe,Te)})}function we(fe){var pe=fe&&fe.then;if(fe&&(typeof fe=="object"||typeof fe=="function")&&typeof pe=="function")return function(){pe.apply(fe,arguments)}}function se(fe,pe){var ve=!1;function Te(De){ve||(ve=!0,Y.reject(fe,De))}function me(De){ve||(ve=!0,Y.resolve(fe,De))}var _e=ye(function(){pe(me,Te)});_e.status==="error"&&Te(_e.value)}function ye(fe,pe){var ve={};try{ve.value=fe(pe),ve.status="success"}catch(Te){ve.status="error",ve.value=Te}return ve}N.exports=ne,ne.prototype.catch=function(fe){return this.then(null,fe)},ne.prototype.then=function(fe,pe){if(typeof fe!="function"&&this.state===te||typeof pe!="function"&&this.state===Q)return this;var ve=new this.constructor(X);return this.state!==ie?ce(ve,this.state===te?fe:pe,this.outcome):this.queue.push(new oe(ve,fe,pe)),ve},oe.prototype.callFulfilled=function(fe){Y.resolve(this.promise,fe)},oe.prototype.otherCallFulfilled=function(fe){ce(this.promise,this.onFulfilled,fe)},oe.prototype.callRejected=function(fe){Y.reject(this.promise,fe)},oe.prototype.otherCallRejected=function(fe){ce(this.promise,this.onRejected,fe)},Y.resolve=function(fe,pe){var ve=ye(we,pe);if(ve.status==="error")return Y.reject(fe,ve.value);var Te=ve.value;if(Te)se(fe,Te);else{fe.state=te,fe.outcome=pe;for(var me=-1,_e=fe.queue.length;++me<_e;)fe.queue[me].callFulfilled(pe)}return fe},Y.reject=function(fe,pe){fe.state=Q,fe.outcome=pe;for(var ve=-1,Te=fe.queue.length;++ve<Te;)fe.queue[ve].callRejected(pe);return fe},ne.resolve=function(fe){return fe instanceof this?fe:Y.resolve(new this(X),fe)},ne.reject=function(fe){var pe=new this(X);return Y.reject(pe,fe)},ne.all=function(fe){var pe=this;if(Object.prototype.toString.call(fe)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ve=fe.length,Te=!1;if(!ve)return this.resolve([]);for(var me=new Array(ve),_e=0,De=-1,je=new this(X);++De<ve;)Fe(fe[De],De);return je;function Fe(qe,gt){pe.resolve(qe).then(function(St){me[gt]=St,++_e!==ve||Te||(Te=!0,Y.resolve(je,me))},function(St){Te||(Te=!0,Y.reject(je,St))})}},ne.race=function(fe){if(Object.prototype.toString.call(fe)!=="[object Array]")return this.reject(new TypeError("must be an array"));var pe,ve=fe.length,Te=!1;if(!ve)return this.resolve([]);for(var me=-1,_e=new this(X);++me<ve;)pe=fe[me],this.resolve(pe).then(function(De){Te||(Te=!0,Y.resolve(_e,De))},function(De){Te||(Te=!0,Y.reject(_e,De))});return _e}},{1:1}],3:[function(k,N,F){(function(J){typeof J.Promise!="function"&&(J.Promise=k(2))}).call(this,o.g!==void 0?o.g:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(k,N,F){var J=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae},X=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function Y(ae,de){ae=ae||[],de=de||{};try{return new Blob(ae,de)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var he=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),Ee=0;Ee<ae.length;Ee+=1)he.append(ae[Ee]);return he.getBlob(de.type)}}typeof Promise>"u"&&k(3);var Q=Promise;function te(ae,de){de&&ae.then(function(he){de(null,he)},function(he){de(he)})}function ie(ae,de,he){typeof de=="function"&&ae.then(de),typeof he=="function"&&ae.catch(he)}function ne(ae){return typeof ae!="string"&&(console.warn(ae+" used as a key, but it is not a string."),ae=String(ae)),ae}function oe(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var ce="local-forage-detect-blob-support",we=void 0,se={},ye=Object.prototype.toString,fe="readonly",pe="readwrite";function ve(ae){for(var de=ae.length,he=new ArrayBuffer(de),Ee=new Uint8Array(he),Oe=0;Oe<de;Oe++)Ee[Oe]=ae.charCodeAt(Oe);return he}function Te(ae){return typeof we=="boolean"?Q.resolve(we):function(de){return new Q(function(he){var Ee=de.transaction(ce,pe),Oe=Y([""]);Ee.objectStore(ce).put(Oe,"key"),Ee.onabort=function(Ie){Ie.preventDefault(),Ie.stopPropagation(),he(!1)},Ee.oncomplete=function(){var Ie=navigator.userAgent.match(/Chrome\/(\d+)/),Be=navigator.userAgent.match(/Edge\//);he(Be||!Ie||parseInt(Ie[1],10)>=43)}}).catch(function(){return!1})}(ae).then(function(de){return we=de})}function me(ae){var de=se[ae.name],he={};he.promise=new Q(function(Ee,Oe){he.resolve=Ee,he.reject=Oe}),de.deferredOperations.push(he),de.dbReady?de.dbReady=de.dbReady.then(function(){return he.promise}):de.dbReady=he.promise}function _e(ae){var de=se[ae.name].deferredOperations.pop();if(de)return de.resolve(),de.promise}function De(ae,de){var he=se[ae.name].deferredOperations.pop();if(he)return he.reject(de),he.promise}function je(ae,de){return new Q(function(he,Ee){if(se[ae.name]=se[ae.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},ae.db){if(!de)return he(ae.db);me(ae),ae.db.close()}var Oe=[ae.name];de&&Oe.push(ae.version);var Ie=X.open.apply(X,Oe);de&&(Ie.onupgradeneeded=function(Be){var Ue=Ie.result;try{Ue.createObjectStore(ae.storeName),Be.oldVersion<=1&&Ue.createObjectStore(ce)}catch(He){if(He.name!=="ConstraintError")throw He;console.warn('The database "'+ae.name+'" has been upgraded from version '+Be.oldVersion+" to version "+Be.newVersion+', but the storage "'+ae.storeName+'" already exists.')}}),Ie.onerror=function(Be){Be.preventDefault(),Ee(Ie.error)},Ie.onsuccess=function(){var Be=Ie.result;Be.onversionchange=function(Ue){Ue.target.close()},he(Be),_e(ae)}})}function Fe(ae){return je(ae,!1)}function qe(ae){return je(ae,!0)}function gt(ae,de){if(!ae.db)return!0;var he=!ae.db.objectStoreNames.contains(ae.storeName),Ee=ae.version<ae.db.version,Oe=ae.version>ae.db.version;if(Ee&&(ae.version!==de&&console.warn('The database "'+ae.name+`" can't be downgraded from version `+ae.db.version+" to version "+ae.version+"."),ae.version=ae.db.version),Oe||he){if(he){var Ie=ae.db.version+1;Ie>ae.version&&(ae.version=Ie)}return!0}return!1}function St(ae){return Y([ve(atob(ae.data))],{type:ae.type})}function It(ae){return ae&&ae.__local_forage_encoded_blob}function Lt(ae){var de=this,he=de._initReady().then(function(){var Ee=se[de._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return ie(he,ae,ae),he}function Nt(ae,de,he,Ee){Ee===void 0&&(Ee=1);try{var Oe=ae.db.transaction(ae.storeName,de);he(null,Oe)}catch(Ie){if(Ee>0&&(!ae.db||Ie.name==="InvalidStateError"||Ie.name==="NotFoundError"))return Q.resolve().then(function(){if(!ae.db||Ie.name==="NotFoundError"&&!ae.db.objectStoreNames.contains(ae.storeName)&&ae.version<=ae.db.version)return ae.db&&(ae.version=ae.db.version+1),qe(ae)}).then(function(){return function(Be){me(Be);for(var Ue=se[Be.name],He=Ue.forages,Pe=0;Pe<He.length;Pe++){var ze=He[Pe];ze._dbInfo.db&&(ze._dbInfo.db.close(),ze._dbInfo.db=null)}return Be.db=null,Fe(Be).then(function(Ve){return Be.db=Ve,gt(Be)?qe(Be):Ve}).then(function(Ve){Be.db=Ue.db=Ve;for(var Ye=0;Ye<He.length;Ye++)He[Ye]._dbInfo.db=Ve}).catch(function(Ve){throw De(Be,Ve),Ve})}(ae).then(function(){Nt(ae,de,he,Ee-1)})}).catch(he);he(Ie)}}var yt={_driver:"asyncStorage",_initStorage:function(ae){var de=this,he={db:null};if(ae)for(var Ee in ae)he[Ee]=ae[Ee];var Oe=se[he.name];Oe||(Oe={forages:[],db:null,dbReady:null,deferredOperations:[]},se[he.name]=Oe),Oe.forages.push(de),de._initReady||(de._initReady=de.ready,de.ready=Lt);var Ie=[];function Be(){return Q.resolve()}for(var Ue=0;Ue<Oe.forages.length;Ue++){var He=Oe.forages[Ue];He!==de&&Ie.push(He._initReady().catch(Be))}var Pe=Oe.forages.slice(0);return Q.all(Ie).then(function(){return he.db=Oe.db,Fe(he)}).then(function(ze){return he.db=ze,gt(he,de._defaultConfig.version)?qe(he):ze}).then(function(ze){he.db=Oe.db=ze,de._dbInfo=he;for(var Ve=0;Ve<Pe.length;Ve++){var Ye=Pe[Ve];Ye!==de&&(Ye._dbInfo.db=he.db,Ye._dbInfo.version=he.version)}})},_support:function(){try{if(!X||!X.open)return!1;var ae=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),de=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!ae||de)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(ae,de){var he=this,Ee=new Q(function(Oe,Ie){he.ready().then(function(){Nt(he._dbInfo,fe,function(Be,Ue){if(Be)return Ie(Be);try{var He=Ue.objectStore(he._dbInfo.storeName).openCursor(),Pe=1;He.onsuccess=function(){var ze=He.result;if(ze){var Ve=ze.value;It(Ve)&&(Ve=St(Ve));var Ye=ae(Ve,ze.key,Pe++);Ye!==void 0?Oe(Ye):ze.continue()}else Oe()},He.onerror=function(){Ie(He.error)}}catch(ze){Ie(ze)}})}).catch(Ie)});return te(Ee,de),Ee},getItem:function(ae,de){var he=this;ae=ne(ae);var Ee=new Q(function(Oe,Ie){he.ready().then(function(){Nt(he._dbInfo,fe,function(Be,Ue){if(Be)return Ie(Be);try{var He=Ue.objectStore(he._dbInfo.storeName).get(ae);He.onsuccess=function(){var Pe=He.result;Pe===void 0&&(Pe=null),It(Pe)&&(Pe=St(Pe)),Oe(Pe)},He.onerror=function(){Ie(He.error)}}catch(Pe){Ie(Pe)}})}).catch(Ie)});return te(Ee,de),Ee},setItem:function(ae,de,he){var Ee=this;ae=ne(ae);var Oe=new Q(function(Ie,Be){var Ue;Ee.ready().then(function(){return Ue=Ee._dbInfo,ye.call(de)==="[object Blob]"?Te(Ue.db).then(function(He){return He?de:(Pe=de,new Q(function(ze,Ve){var Ye=new FileReader;Ye.onerror=Ve,Ye.onloadend=function(at){var ft=btoa(at.target.result||"");ze({__local_forage_encoded_blob:!0,data:ft,type:Pe.type})},Ye.readAsBinaryString(Pe)}));var Pe}):de}).then(function(He){Nt(Ee._dbInfo,pe,function(Pe,ze){if(Pe)return Be(Pe);try{var Ve=ze.objectStore(Ee._dbInfo.storeName);He===null&&(He=void 0);var Ye=Ve.put(He,ae);ze.oncomplete=function(){He===void 0&&(He=null),Ie(He)},ze.onabort=ze.onerror=function(){var at=Ye.error?Ye.error:Ye.transaction.error;Be(at)}}catch(at){Be(at)}})}).catch(Be)});return te(Oe,he),Oe},removeItem:function(ae,de){var he=this;ae=ne(ae);var Ee=new Q(function(Oe,Ie){he.ready().then(function(){Nt(he._dbInfo,pe,function(Be,Ue){if(Be)return Ie(Be);try{var He=Ue.objectStore(he._dbInfo.storeName).delete(ae);Ue.oncomplete=function(){Oe()},Ue.onerror=function(){Ie(He.error)},Ue.onabort=function(){var Pe=He.error?He.error:He.transaction.error;Ie(Pe)}}catch(Pe){Ie(Pe)}})}).catch(Ie)});return te(Ee,de),Ee},clear:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){Nt(de._dbInfo,pe,function(Ie,Be){if(Ie)return Oe(Ie);try{var Ue=Be.objectStore(de._dbInfo.storeName).clear();Be.oncomplete=function(){Ee()},Be.onabort=Be.onerror=function(){var He=Ue.error?Ue.error:Ue.transaction.error;Oe(He)}}catch(He){Oe(He)}})}).catch(Oe)});return te(he,ae),he},length:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){Nt(de._dbInfo,fe,function(Ie,Be){if(Ie)return Oe(Ie);try{var Ue=Be.objectStore(de._dbInfo.storeName).count();Ue.onsuccess=function(){Ee(Ue.result)},Ue.onerror=function(){Oe(Ue.error)}}catch(He){Oe(He)}})}).catch(Oe)});return te(he,ae),he},key:function(ae,de){var he=this,Ee=new Q(function(Oe,Ie){ae<0?Oe(null):he.ready().then(function(){Nt(he._dbInfo,fe,function(Be,Ue){if(Be)return Ie(Be);try{var He=Ue.objectStore(he._dbInfo.storeName),Pe=!1,ze=He.openKeyCursor();ze.onsuccess=function(){var Ve=ze.result;Ve?ae===0||Pe?Oe(Ve.key):(Pe=!0,Ve.advance(ae)):Oe(null)},ze.onerror=function(){Ie(ze.error)}}catch(Ve){Ie(Ve)}})}).catch(Ie)});return te(Ee,de),Ee},keys:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){Nt(de._dbInfo,fe,function(Ie,Be){if(Ie)return Oe(Ie);try{var Ue=Be.objectStore(de._dbInfo.storeName).openKeyCursor(),He=[];Ue.onsuccess=function(){var Pe=Ue.result;Pe?(He.push(Pe.key),Pe.continue()):Ee(He)},Ue.onerror=function(){Oe(Ue.error)}}catch(Pe){Oe(Pe)}})}).catch(Oe)});return te(he,ae),he},dropInstance:function(ae,de){de=oe.apply(this,arguments);var he=this.config();(ae=typeof ae!="function"&&ae||{}).name||(ae.name=ae.name||he.name,ae.storeName=ae.storeName||he.storeName);var Ee,Oe=this;if(ae.name){var Ie=ae.name===he.name&&Oe._dbInfo.db?Q.resolve(Oe._dbInfo.db):Fe(ae).then(function(Be){var Ue=se[ae.name],He=Ue.forages;Ue.db=Be;for(var Pe=0;Pe<He.length;Pe++)He[Pe]._dbInfo.db=Be;return Be});Ee=ae.storeName?Ie.then(function(Be){if(Be.objectStoreNames.contains(ae.storeName)){var Ue=Be.version+1;me(ae);var He=se[ae.name],Pe=He.forages;Be.close();for(var ze=0;ze<Pe.length;ze++){var Ve=Pe[ze];Ve._dbInfo.db=null,Ve._dbInfo.version=Ue}var Ye=new Q(function(at,ft){var Dt=X.open(ae.name,Ue);Dt.onerror=function(tn){Dt.result.close(),ft(tn)},Dt.onupgradeneeded=function(){Dt.result.deleteObjectStore(ae.storeName)},Dt.onsuccess=function(){var tn=Dt.result;tn.close(),at(tn)}});return Ye.then(function(at){He.db=at;for(var ft=0;ft<Pe.length;ft++){var Dt=Pe[ft];Dt._dbInfo.db=at,_e(Dt._dbInfo)}}).catch(function(at){throw(De(ae,at)||Q.resolve()).catch(function(){}),at})}}):Ie.then(function(Be){me(ae);var Ue=se[ae.name],He=Ue.forages;Be.close();for(var Pe=0;Pe<He.length;Pe++)He[Pe]._dbInfo.db=null;var ze=new Q(function(Ve,Ye){var at=X.deleteDatabase(ae.name);at.onerror=function(){var ft=at.result;ft&&ft.close(),Ye(at.error)},at.onblocked=function(){console.warn('dropInstance blocked for database "'+ae.name+'" until all open connections are closed')},at.onsuccess=function(){var ft=at.result;ft&&ft.close(),Ve(ft)}});return ze.then(function(Ve){Ue.db=Ve;for(var Ye=0;Ye<He.length;Ye++)_e(He[Ye]._dbInfo)}).catch(function(Ve){throw(De(ae,Ve)||Q.resolve()).catch(function(){}),Ve})})}else Ee=Q.reject("Invalid arguments");return te(Ee,de),Ee}},tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",zt=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",Ne=Ot.length,nt="arbf",Ht="blob",At="si08",et="ui08",Qe="uic8",rt="si16",it="si32",vt="ur16",Rt="ui32",Mt="fl32",qt="fl64",Jt=Ne+nt.length,Wt=Object.prototype.toString;function cn(ae){var de,he,Ee,Oe,Ie,Be=.75*ae.length,Ue=ae.length,He=0;ae[ae.length-1]==="="&&(Be--,ae[ae.length-2]==="="&&Be--);var Pe=new ArrayBuffer(Be),ze=new Uint8Array(Pe);for(de=0;de<Ue;de+=4)he=tt.indexOf(ae[de]),Ee=tt.indexOf(ae[de+1]),Oe=tt.indexOf(ae[de+2]),Ie=tt.indexOf(ae[de+3]),ze[He++]=he<<2|Ee>>4,ze[He++]=(15&Ee)<<4|Oe>>2,ze[He++]=(3&Oe)<<6|63&Ie;return Pe}function Yt(ae){var de,he=new Uint8Array(ae),Ee="";for(de=0;de<he.length;de+=3)Ee+=tt[he[de]>>2],Ee+=tt[(3&he[de])<<4|he[de+1]>>4],Ee+=tt[(15&he[de+1])<<2|he[de+2]>>6],Ee+=tt[63&he[de+2]];return he.length%3==2?Ee=Ee.substring(0,Ee.length-1)+"=":he.length%3==1&&(Ee=Ee.substring(0,Ee.length-2)+"=="),Ee}var Xt={serialize:function(ae,de){var he="";if(ae&&(he=Wt.call(ae)),ae&&(he==="[object ArrayBuffer]"||ae.buffer&&Wt.call(ae.buffer)==="[object ArrayBuffer]")){var Ee,Oe=Ot;ae instanceof ArrayBuffer?(Ee=ae,Oe+=nt):(Ee=ae.buffer,he==="[object Int8Array]"?Oe+=At:he==="[object Uint8Array]"?Oe+=et:he==="[object Uint8ClampedArray]"?Oe+=Qe:he==="[object Int16Array]"?Oe+=rt:he==="[object Uint16Array]"?Oe+=vt:he==="[object Int32Array]"?Oe+=it:he==="[object Uint32Array]"?Oe+=Rt:he==="[object Float32Array]"?Oe+=Mt:he==="[object Float64Array]"?Oe+=qt:de(new Error("Failed to get type for BinaryArray"))),de(Oe+Yt(Ee))}else if(he==="[object Blob]"){var Ie=new FileReader;Ie.onload=function(){var Be="~~local_forage_type~"+ae.type+"~"+Yt(this.result);de("__lfsc__:blob"+Be)},Ie.readAsArrayBuffer(ae)}else try{de(JSON.stringify(ae))}catch(Be){console.error("Couldn't convert value into a JSON string: ",ae),de(null,Be)}},deserialize:function(ae){if(ae.substring(0,Ne)!==Ot)return JSON.parse(ae);var de,he=ae.substring(Jt),Ee=ae.substring(Ne,Jt);if(Ee===Ht&&zt.test(he)){var Oe=he.match(zt);de=Oe[1],he=he.substring(Oe[0].length)}var Ie=cn(he);switch(Ee){case nt:return Ie;case Ht:return Y([Ie],{type:de});case At:return new Int8Array(Ie);case et:return new Uint8Array(Ie);case Qe:return new Uint8ClampedArray(Ie);case rt:return new Int16Array(Ie);case vt:return new Uint16Array(Ie);case it:return new Int32Array(Ie);case Rt:return new Uint32Array(Ie);case Mt:return new Float32Array(Ie);case qt:return new Float64Array(Ie);default:throw new Error("Unkown type: "+Ee)}},stringToBuffer:cn,bufferToString:Yt};function jt(ae,de,he,Ee){ae.executeSql("CREATE TABLE IF NOT EXISTS "+de.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],he,Ee)}function Vt(ae,de,he,Ee,Oe,Ie){ae.executeSql(he,Ee,Oe,function(Be,Ue){Ue.code===Ue.SYNTAX_ERR?Be.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[de.storeName],function(He,Pe){Pe.rows.length?Ie(He,Ue):jt(He,de,function(){He.executeSql(he,Ee,Oe,Ie)},Ie)},Ie):Ie(Be,Ue)},Ie)}function yn(ae,de,he,Ee){var Oe=this;ae=ne(ae);var Ie=new Q(function(Be,Ue){Oe.ready().then(function(){de===void 0&&(de=null);var He=de,Pe=Oe._dbInfo;Pe.serializer.serialize(de,function(ze,Ve){Ve?Ue(Ve):Pe.db.transaction(function(Ye){Vt(Ye,Pe,"INSERT OR REPLACE INTO "+Pe.storeName+" (key, value) VALUES (?, ?)",[ae,ze],function(){Be(He)},function(at,ft){Ue(ft)})},function(Ye){if(Ye.code===Ye.QUOTA_ERR){if(Ee>0)return void Be(yn.apply(Oe,[ae,He,he,Ee-1]));Ue(Ye)}})})}).catch(Ue)});return te(Ie,he),Ie}function en(ae){return new Q(function(de,he){ae.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Oe,Ie){for(var Be=[],Ue=0;Ue<Ie.rows.length;Ue++)Be.push(Ie.rows.item(Ue).name);de({db:ae,storeNames:Be})},function(Oe,Ie){he(Ie)})},function(Ee){he(Ee)})})}var Zt={_driver:"webSQLStorage",_initStorage:function(ae){var de=this,he={db:null};if(ae)for(var Ee in ae)he[Ee]=typeof ae[Ee]!="string"?ae[Ee].toString():ae[Ee];var Oe=new Q(function(Ie,Be){try{he.db=openDatabase(he.name,String(he.version),he.description,he.size)}catch(Ue){return Be(Ue)}he.db.transaction(function(Ue){jt(Ue,he,function(){de._dbInfo=he,Ie()},function(He,Pe){Be(Pe)})},Be)});return he.serializer=Xt,Oe},_support:typeof openDatabase=="function",iterate:function(ae,de){var he=this,Ee=new Q(function(Oe,Ie){he.ready().then(function(){var Be=he._dbInfo;Be.db.transaction(function(Ue){Vt(Ue,Be,"SELECT * FROM "+Be.storeName,[],function(He,Pe){for(var ze=Pe.rows,Ve=ze.length,Ye=0;Ye<Ve;Ye++){var at=ze.item(Ye),ft=at.value;if(ft&&(ft=Be.serializer.deserialize(ft)),(ft=ae(ft,at.key,Ye+1))!==void 0)return void Oe(ft)}Oe()},function(He,Pe){Ie(Pe)})})}).catch(Ie)});return te(Ee,de),Ee},getItem:function(ae,de){var he=this;ae=ne(ae);var Ee=new Q(function(Oe,Ie){he.ready().then(function(){var Be=he._dbInfo;Be.db.transaction(function(Ue){Vt(Ue,Be,"SELECT * FROM "+Be.storeName+" WHERE key = ? LIMIT 1",[ae],function(He,Pe){var ze=Pe.rows.length?Pe.rows.item(0).value:null;ze&&(ze=Be.serializer.deserialize(ze)),Oe(ze)},function(He,Pe){Ie(Pe)})})}).catch(Ie)});return te(Ee,de),Ee},setItem:function(ae,de,he){return yn.apply(this,[ae,de,he,1])},removeItem:function(ae,de){var he=this;ae=ne(ae);var Ee=new Q(function(Oe,Ie){he.ready().then(function(){var Be=he._dbInfo;Be.db.transaction(function(Ue){Vt(Ue,Be,"DELETE FROM "+Be.storeName+" WHERE key = ?",[ae],function(){Oe()},function(He,Pe){Ie(Pe)})})}).catch(Ie)});return te(Ee,de),Ee},clear:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){var Ie=de._dbInfo;Ie.db.transaction(function(Be){Vt(Be,Ie,"DELETE FROM "+Ie.storeName,[],function(){Ee()},function(Ue,He){Oe(He)})})}).catch(Oe)});return te(he,ae),he},length:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){var Ie=de._dbInfo;Ie.db.transaction(function(Be){Vt(Be,Ie,"SELECT COUNT(key) as c FROM "+Ie.storeName,[],function(Ue,He){var Pe=He.rows.item(0).c;Ee(Pe)},function(Ue,He){Oe(He)})})}).catch(Oe)});return te(he,ae),he},key:function(ae,de){var he=this,Ee=new Q(function(Oe,Ie){he.ready().then(function(){var Be=he._dbInfo;Be.db.transaction(function(Ue){Vt(Ue,Be,"SELECT key FROM "+Be.storeName+" WHERE id = ? LIMIT 1",[ae+1],function(He,Pe){var ze=Pe.rows.length?Pe.rows.item(0).key:null;Oe(ze)},function(He,Pe){Ie(Pe)})})}).catch(Ie)});return te(Ee,de),Ee},keys:function(ae){var de=this,he=new Q(function(Ee,Oe){de.ready().then(function(){var Ie=de._dbInfo;Ie.db.transaction(function(Be){Vt(Be,Ie,"SELECT key FROM "+Ie.storeName,[],function(Ue,He){for(var Pe=[],ze=0;ze<He.rows.length;ze++)Pe.push(He.rows.item(ze).key);Ee(Pe)},function(Ue,He){Oe(He)})})}).catch(Oe)});return te(he,ae),he},dropInstance:function(ae,de){de=oe.apply(this,arguments);var he=this.config();(ae=typeof ae!="function"&&ae||{}).name||(ae.name=ae.name||he.name,ae.storeName=ae.storeName||he.storeName);var Ee,Oe=this;return te(Ee=ae.name?new Q(function(Ie){var Be;Be=ae.name===he.name?Oe._dbInfo.db:openDatabase(ae.name,"","",0),ae.storeName?Ie({db:Be,storeNames:[ae.storeName]}):Ie(en(Be))}).then(function(Ie){return new Q(function(Be,Ue){Ie.db.transaction(function(He){function Pe(at){return new Q(function(ft,Dt){He.executeSql("DROP TABLE IF EXISTS "+at,[],function(){ft()},function(tn,vn){Dt(vn)})})}for(var ze=[],Ve=0,Ye=Ie.storeNames.length;Ve<Ye;Ve++)ze.push(Pe(Ie.storeNames[Ve]));Q.all(ze).then(function(){Be()}).catch(function(at){Ue(at)})},function(He){Ue(He)})})}):Q.reject("Invalid arguments"),de),Ee}};function re(ae,de){var he=ae.name+"/";return ae.storeName!==de.storeName&&(he+=ae.storeName+"/"),he}var Z={_driver:"localStorageWrapper",_initStorage:function(ae){var de={};if(ae)for(var he in ae)de[he]=ae[he];return de.keyPrefix=re(ae,this._defaultConfig),!function(){var Ee="_localforage_support_test";try{return localStorage.setItem(Ee,!0),localStorage.removeItem(Ee),!1}catch{return!0}}()||localStorage.length>0?(this._dbInfo=de,de.serializer=Xt,Q.resolve()):Q.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(ae,de){var he=this,Ee=he.ready().then(function(){for(var Oe=he._dbInfo,Ie=Oe.keyPrefix,Be=Ie.length,Ue=localStorage.length,He=1,Pe=0;Pe<Ue;Pe++){var ze=localStorage.key(Pe);if(ze.indexOf(Ie)===0){var Ve=localStorage.getItem(ze);if(Ve&&(Ve=Oe.serializer.deserialize(Ve)),(Ve=ae(Ve,ze.substring(Be),He++))!==void 0)return Ve}}});return te(Ee,de),Ee},getItem:function(ae,de){var he=this;ae=ne(ae);var Ee=he.ready().then(function(){var Oe=he._dbInfo,Ie=localStorage.getItem(Oe.keyPrefix+ae);return Ie&&(Ie=Oe.serializer.deserialize(Ie)),Ie});return te(Ee,de),Ee},setItem:function(ae,de,he){var Ee=this;ae=ne(ae);var Oe=Ee.ready().then(function(){de===void 0&&(de=null);var Ie=de;return new Q(function(Be,Ue){var He=Ee._dbInfo;He.serializer.serialize(de,function(Pe,ze){if(ze)Ue(ze);else try{localStorage.setItem(He.keyPrefix+ae,Pe),Be(Ie)}catch(Ve){Ve.name!=="QuotaExceededError"&&Ve.name!=="NS_ERROR_DOM_QUOTA_REACHED"||Ue(Ve),Ue(Ve)}})})});return te(Oe,he),Oe},removeItem:function(ae,de){var he=this;ae=ne(ae);var Ee=he.ready().then(function(){var Oe=he._dbInfo;localStorage.removeItem(Oe.keyPrefix+ae)});return te(Ee,de),Ee},clear:function(ae){var de=this,he=de.ready().then(function(){for(var Ee=de._dbInfo.keyPrefix,Oe=localStorage.length-1;Oe>=0;Oe--){var Ie=localStorage.key(Oe);Ie.indexOf(Ee)===0&&localStorage.removeItem(Ie)}});return te(he,ae),he},length:function(ae){var de=this.keys().then(function(he){return he.length});return te(de,ae),de},key:function(ae,de){var he=this,Ee=he.ready().then(function(){var Oe,Ie=he._dbInfo;try{Oe=localStorage.key(ae)}catch{Oe=null}return Oe&&(Oe=Oe.substring(Ie.keyPrefix.length)),Oe});return te(Ee,de),Ee},keys:function(ae){var de=this,he=de.ready().then(function(){for(var Ee=de._dbInfo,Oe=localStorage.length,Ie=[],Be=0;Be<Oe;Be++){var Ue=localStorage.key(Be);Ue.indexOf(Ee.keyPrefix)===0&&Ie.push(Ue.substring(Ee.keyPrefix.length))}return Ie});return te(he,ae),he},dropInstance:function(ae,de){if(de=oe.apply(this,arguments),!(ae=typeof ae!="function"&&ae||{}).name){var he=this.config();ae.name=ae.name||he.name,ae.storeName=ae.storeName||he.storeName}var Ee,Oe=this;return Ee=ae.name?new Q(function(Ie){ae.storeName?Ie(re(ae,Oe._defaultConfig)):Ie(ae.name+"/")}).then(function(Ie){for(var Be=localStorage.length-1;Be>=0;Be--){var Ue=localStorage.key(Be);Ue.indexOf(Ie)===0&&localStorage.removeItem(Ue)}}):Q.reject("Invalid arguments"),te(Ee,de),Ee}},K=function(ae,de){for(var he=ae.length,Ee=0;Ee<he;){if((Oe=ae[Ee])===(Ie=de)||typeof Oe=="number"&&typeof Ie=="number"&&isNaN(Oe)&&isNaN(Ie))return!0;Ee++}var Oe,Ie;return!1},ue=Array.isArray||function(ae){return Object.prototype.toString.call(ae)==="[object Array]"},ge={},Ae={},Me={INDEXEDDB:yt,WEBSQL:Zt,LOCALSTORAGE:Z},ot=[Me.INDEXEDDB._driver,Me.WEBSQL._driver,Me.LOCALSTORAGE._driver],_t=["dropInstance"],ut=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_t),Tt={description:"",driver:ot.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function wt(ae,de){ae[de]=function(){var he=arguments;return ae.ready().then(function(){return ae[de].apply(ae,he)})}}function ln(){for(var ae=1;ae<arguments.length;ae++){var de=arguments[ae];if(de)for(var he in de)de.hasOwnProperty(he)&&(ue(de[he])?arguments[0][he]=de[he].slice():arguments[0][he]=de[he])}return arguments[0]}var Qn=function(){function ae(de){for(var he in function(Ie,Be){if(!(Ie instanceof Be))throw new TypeError("Cannot call a class as a function")}(this,ae),Me)if(Me.hasOwnProperty(he)){var Ee=Me[he],Oe=Ee._driver;this[he]=Oe,ge[Oe]||this.defineDriver(Ee)}this._defaultConfig=ln({},Tt),this._config=ln({},this._defaultConfig,de),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return ae.prototype.config=function(de){if((de===void 0?"undefined":J(de))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var he in de){if(he==="storeName"&&(de[he]=de[he].replace(/\W/g,"_")),he==="version"&&typeof de[he]!="number")return new Error("Database version must be a number.");this._config[he]=de[he]}return!("driver"in de)||!de.driver||this.setDriver(this._config.driver)}return typeof de=="string"?this._config[de]:this._config},ae.prototype.defineDriver=function(de,he,Ee){var Oe=new Q(function(Ie,Be){try{var Ue=de._driver,He=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!de._driver)return void Be(He);for(var Pe=ut.concat("_initStorage"),ze=0,Ve=Pe.length;ze<Ve;ze++){var Ye=Pe[ze];if((!K(_t,Ye)||de[Ye])&&typeof de[Ye]!="function")return void Be(He)}(function(){for(var ft=function(Cn){return function(){var Yn=new Error("Method "+Cn+" is not implemented by the current driver"),Ct=Q.reject(Yn);return te(Ct,arguments[arguments.length-1]),Ct}},Dt=0,tn=_t.length;Dt<tn;Dt++){var vn=_t[Dt];de[vn]||(de[vn]=ft(vn))}})();var at=function(ft){ge[Ue]&&console.info("Redefining LocalForage driver: "+Ue),ge[Ue]=de,Ae[Ue]=ft,Ie()};"_support"in de?de._support&&typeof de._support=="function"?de._support().then(at,Be):at(!!de._support):at(!0)}catch(ft){Be(ft)}});return ie(Oe,he,Ee),Oe},ae.prototype.driver=function(){return this._driver||null},ae.prototype.getDriver=function(de,he,Ee){var Oe=ge[de]?Q.resolve(ge[de]):Q.reject(new Error("Driver not found."));return ie(Oe,he,Ee),Oe},ae.prototype.getSerializer=function(de){var he=Q.resolve(Xt);return ie(he,de),he},ae.prototype.ready=function(de){var he=this,Ee=he._driverSet.then(function(){return he._ready===null&&(he._ready=he._initDriver()),he._ready});return ie(Ee,de,de),Ee},ae.prototype.setDriver=function(de,he,Ee){var Oe=this;ue(de)||(de=[de]);var Ie=this._getSupportedDrivers(de);function Be(){Oe._config.driver=Oe.driver()}function Ue(Pe){return Oe._extend(Pe),Be(),Oe._ready=Oe._initStorage(Oe._config),Oe._ready}var He=this._driverSet!==null?this._driverSet.catch(function(){return Q.resolve()}):Q.resolve();return this._driverSet=He.then(function(){var Pe=Ie[0];return Oe._dbInfo=null,Oe._ready=null,Oe.getDriver(Pe).then(function(ze){Oe._driver=ze._driver,Be(),Oe._wrapLibraryMethodsWithReady(),Oe._initDriver=function(Ve){return function(){var Ye=0;return function at(){for(;Ye<Ve.length;){var ft=Ve[Ye];return Ye++,Oe._dbInfo=null,Oe._ready=null,Oe.getDriver(ft).then(Ue).catch(at)}Be();var Dt=new Error("No available storage method found.");return Oe._driverSet=Q.reject(Dt),Oe._driverSet}()}}(Ie)})}).catch(function(){Be();var Pe=new Error("No available storage method found.");return Oe._driverSet=Q.reject(Pe),Oe._driverSet}),ie(this._driverSet,he,Ee),this._driverSet},ae.prototype.supports=function(de){return!!Ae[de]},ae.prototype._extend=function(de){ln(this,de)},ae.prototype._getSupportedDrivers=function(de){for(var he=[],Ee=0,Oe=de.length;Ee<Oe;Ee++){var Ie=de[Ee];this.supports(Ie)&&he.push(Ie)}return he},ae.prototype._wrapLibraryMethodsWithReady=function(){for(var de=0,he=ut.length;de<he;de++)wt(this,ut[de])},ae.prototype.createInstance=function(de){return new ae(de)},ae}(),Kn=new Qn;N.exports=Kn},{3:3}]},{},[4])(4)},961:(O,I,o)=>{var k,N=function(){var F=String.fromCharCode,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",Y={};function Q(ie,ne){if(!Y[ie]){Y[ie]={};for(var oe=0;oe<ie.length;oe++)Y[ie][ie.charAt(oe)]=oe}return Y[ie][ne]}var te={compressToBase64:function(ie){if(ie==null)return"";var ne=te._compress(ie,6,function(oe){return J.charAt(oe)});switch(ne.length%4){default:case 0:return ne;case 1:return ne+"===";case 2:return ne+"==";case 3:return ne+"="}},decompressFromBase64:function(ie){return ie==null?"":ie==""?null:te._decompress(ie.length,32,function(ne){return Q(J,ie.charAt(ne))})},compressToUTF16:function(ie){return ie==null?"":te._compress(ie,15,function(ne){return F(ne+32)})+" "},decompressFromUTF16:function(ie){return ie==null?"":ie==""?null:te._decompress(ie.length,16384,function(ne){return ie.charCodeAt(ne)-32})},compressToUint8Array:function(ie){for(var ne=te.compress(ie),oe=new Uint8Array(2*ne.length),ce=0,we=ne.length;ce<we;ce++){var se=ne.charCodeAt(ce);oe[2*ce]=se>>>8,oe[2*ce+1]=se%256}return oe},decompressFromUint8Array:function(ie){if(ie==null)return te.decompress(ie);for(var ne=new Array(ie.length/2),oe=0,ce=ne.length;oe<ce;oe++)ne[oe]=256*ie[2*oe]+ie[2*oe+1];var we=[];return ne.forEach(function(se){we.push(F(se))}),te.decompress(we.join(""))},compressToEncodedURIComponent:function(ie){return ie==null?"":te._compress(ie,6,function(ne){return X.charAt(ne)})},decompressFromEncodedURIComponent:function(ie){return ie==null?"":ie==""?null:(ie=ie.replace(/ /g,"+"),te._decompress(ie.length,32,function(ne){return Q(X,ie.charAt(ne))}))},compress:function(ie){return te._compress(ie,16,function(ne){return F(ne)})},_compress:function(ie,ne,oe){if(ie==null)return"";var ce,we,se,ye={},fe={},pe="",ve="",Te="",me=2,_e=3,De=2,je=[],Fe=0,qe=0;for(se=0;se<ie.length;se+=1)if(pe=ie.charAt(se),Object.prototype.hasOwnProperty.call(ye,pe)||(ye[pe]=_e++,fe[pe]=!0),ve=Te+pe,Object.prototype.hasOwnProperty.call(ye,ve))Te=ve;else{if(Object.prototype.hasOwnProperty.call(fe,Te)){if(Te.charCodeAt(0)<256){for(ce=0;ce<De;ce++)Fe<<=1,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++;for(we=Te.charCodeAt(0),ce=0;ce<8;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1}else{for(we=1,ce=0;ce<De;ce++)Fe=Fe<<1|we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we=0;for(we=Te.charCodeAt(0),ce=0;ce<16;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1}--me==0&&(me=Math.pow(2,De),De++),delete fe[Te]}else for(we=ye[Te],ce=0;ce<De;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1;--me==0&&(me=Math.pow(2,De),De++),ye[ve]=_e++,Te=String(pe)}if(Te!==""){if(Object.prototype.hasOwnProperty.call(fe,Te)){if(Te.charCodeAt(0)<256){for(ce=0;ce<De;ce++)Fe<<=1,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++;for(we=Te.charCodeAt(0),ce=0;ce<8;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1}else{for(we=1,ce=0;ce<De;ce++)Fe=Fe<<1|we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we=0;for(we=Te.charCodeAt(0),ce=0;ce<16;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1}--me==0&&(me=Math.pow(2,De),De++),delete fe[Te]}else for(we=ye[Te],ce=0;ce<De;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1;--me==0&&(me=Math.pow(2,De),De++)}for(we=2,ce=0;ce<De;ce++)Fe=Fe<<1|1&we,qe==ne-1?(qe=0,je.push(oe(Fe)),Fe=0):qe++,we>>=1;for(;;){if(Fe<<=1,qe==ne-1){je.push(oe(Fe));break}qe++}return je.join("")},decompress:function(ie){return ie==null?"":ie==""?null:te._decompress(ie.length,32768,function(ne){return ie.charCodeAt(ne)})},_decompress:function(ie,ne,oe){var ce,we,se,ye,fe,pe,ve,Te=[],me=4,_e=4,De=3,je="",Fe=[],qe={val:oe(0),position:ne,index:1};for(ce=0;ce<3;ce+=1)Te[ce]=ce;for(se=0,fe=Math.pow(2,2),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;switch(se){case 0:for(se=0,fe=Math.pow(2,8),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;ve=F(se);break;case 1:for(se=0,fe=Math.pow(2,16),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;ve=F(se);break;case 2:return""}for(Te[3]=ve,we=ve,Fe.push(ve);;){if(qe.index>ie)return"";for(se=0,fe=Math.pow(2,De),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;switch(ve=se){case 0:for(se=0,fe=Math.pow(2,8),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;Te[_e++]=F(se),ve=_e-1,me--;break;case 1:for(se=0,fe=Math.pow(2,16),pe=1;pe!=fe;)ye=qe.val&qe.position,qe.position>>=1,qe.position==0&&(qe.position=ne,qe.val=oe(qe.index++)),se|=(ye>0?1:0)*pe,pe<<=1;Te[_e++]=F(se),ve=_e-1,me--;break;case 2:return Fe.join("")}if(me==0&&(me=Math.pow(2,De),De++),Te[ve])je=Te[ve];else{if(ve!==_e)return null;je=we+we.charAt(0)}Fe.push(je),Te[_e++]=we+je.charAt(0),we=je,--me==0&&(me=Math.pow(2,De),De++)}}};return te}();(k=(function(){return N}).call(I,o,I,O))===void 0||(O.exports=k)},895:O=>{O.exports=function(I,o,k,N){var F=I[0],J=I[1],X=!1;k===void 0&&(k=0),N===void 0&&(N=o.length);for(var Y=(N-k)/2,Q=0,te=Y-1;Q<Y;te=Q++){var ie=o[k+2*Q+0],ne=o[k+2*Q+1],oe=o[k+2*te+0],ce=o[k+2*te+1];ne>J!=ce>J&&F<(oe-ie)*(J-ne)/(ce-ne)+ie&&(X=!X)}return X}},946:(O,I,o)=>{const k=o(909),N=async()=>await k.get({dir:"areaList",file:"index"}),F=({name:te,list:ie})=>{let ne=te;const oe=ie.find(we=>ne.indexOf(we.name)!==-1);if(oe){const we=oe.name.length;return ne=ne.slice(we,te.length),{id:oe.id,name:ne,children:oe.children}}const ce=ie.find(we=>ne.indexOf(we.shortName)!==-1);if(ce){const we=ce.shortName.length;return ne=ne.slice(we,te.length),{id:ce.id,name:ne,children:ce.children}}return null},J=async(te="",ie)=>{let ne=te;const oe={province:"",city:"",district:""};let ce=ie;ie||(ce=await N());const we=F({name:ne,list:ce});if(we){ne=we.name,oe.province=we.id;const fe=we.children,pe=F({name:ne,list:fe});if(pe){ne=pe.name,oe.city=pe.id;const me=F({name:ne,list:pe.children});return me&&(ne=me.name,oe.district=me.id),oe}const ve=fe.reduce((me,_e)=>_e.children?me.concat(_e.children):me,[]),Te=F({name:ne,list:ve});return Te&&(ne=Te.name,oe.district=Te.id),oe}const se=ce.reduce((fe,pe)=>pe.children?fe.concat(pe.children):fe,[]),ye=F({name:ne,list:se});if(ye){ne=ye.name,oe.city=ye.id;const fe=F({name:ne,list:ye.children});fe&&(ne=fe.name,oe.district=fe.id)}return oe},X=async(te={})=>{let{code:ie}={...te};ie=typeof ie=="string"?ie:ie.toString();const ne={province:"",provinceCode:"",city:"",cityCode:"",district:"",districtCode:"",code:ie,address:""};if((await N()).every(oe=>oe.id===ie?(ne.province=oe.name,ne.provinceCode=oe.id,!1):!oe.children||oe.children.every(ce=>ce.id===ie?(ne.province=oe.name,ne.provinceCode=oe.id,ne.city=ce.name,ne.cityCode=ce.id,!1):!ce.children||ce.children.every(we=>we.id!==ie||(ne.province=oe.name,ne.provinceCode=oe.id,ne.city=ce.name,ne.cityCode=ce.id,ne.district=we.name,ne.districtCode=we.id,!1)))))throw new Error("未找到该地区");return ne.address=ne.province+ne.city+ne.district,ne},Y=async({provinceCode:te,cityCode:ie,districtCode:ne})=>{const oe={province:{},city:{},district:{}};if(te){const ce=await k.get({dir:"province",file:te});oe.province={code:ce.id,location:ce.location,name:ce.name,pinyin:ce.pinyin}}if(ie){const ce=(await k.get({dir:"city",file:te})).find(we=>we.id===ie);oe.city={code:ce.id,location:ce.location,name:ce.name,pinyin:ce.pinyin}}if(ne){const ce=(await k.get({dir:"district",file:ie})).find(we=>we.id===ne);oe.district={code:ce.id,location:ce.location,name:ce.name,pinyin:ce.pinyin}}return oe},Q=async(te,ie)=>{let ne=ie;if(ne||(ne=await N()),!te)return ne.map(oe=>({code:oe.id,name:oe.name}));for(let oe=0;oe<ne.length;oe++){const ce=ne[oe];if(ce.id===te&&ce.children)return ce.children.map(we=>({code:we.id,name:we.name}));if(ce.children){const we=await Q(te,ce.children);if(we)return we}}};O.exports={getList:Q,searchCodeInfo:async({code:te,detail:ie})=>{const{province:ne,city:oe,district:ce,address:we,provinceCode:se,cityCode:ye,districtCode:fe}=await X({code:te}),pe={province:ne,city:oe,district:ce,address:we,code:te};if(ie){const ve=await Y({provinceCode:se,cityCode:ye,districtCode:fe});pe.detail=ve}return pe},searchStrAddress:async te=>{const{province:ie,city:ne,district:oe}=await J(te);return oe||ne||ie||null},analysisAddress:J,searchCodeDetailInfo:async({code:te})=>{const{provinceCode:ie,cityCode:ne,districtCode:oe}=await X({code:te}),ce=await Y({provinceCode:ie,cityCode:ne,districtCode:oe});return Object.keys(ce.district).length?ce.district:Object.keys(ce.city).length?ce.city:Object.keys(ce.province).length?ce.province:void 0}}},182:O=>{O.exports=new class{constructor(){this.config={timeout:1e4,enableHighAccuracy:!1,detail:!1},this.cdn=["https://npm.onmicrosoft.cn/@pikaz/location/lib","https://unpkg.com/@pikaz/location/lib"],this.userCdn=""}set(I){this.config={...this.config,...I},this.config.url&&(this.userCdn=this.config.url)}}},955:(O,I,o)=>{const k=o(909),N=o(895),F=o(182),J=({latitude:X,longitude:Y,address:Q})=>Q.find(te=>te.polygon.find(ie=>{if(N([Y,X],ie))return ie}));O.exports={getGeo:(X={})=>{const{enableHighAccuracy:Y,timeout:Q}={...F.config,...X};return new Promise((te,ie)=>{if(navigator.geolocation){const ne=navigator.geolocation.watchPosition(oe=>{const{latitude:ce,longitude:we}=oe.coords;navigator.geolocation.clearWatch(ne),te({latitude:ce,longitude:we})},oe=>{switch(navigator.geolocation.clearWatch(ne),oe.code){case oe.PERMISSION_DENIED:ie(new Error("html5已拒绝定位"));break;case oe.POSITION_UNAVAILABLE:ie(new Error("html5位置信息不可用"));break;case oe.TIMEOUT:ie(new Error("定位超时"));break;case oe.UNKNOWN_ERROR:ie(new Error("html5定位未知错误"))}},{enableHighAccuracy:Y,timeout:Q,maximumAge:0})}else ie(new Error("浏览器不支持HTML5定位"))})},getGeoCode:async({latitude:X,longitude:Y})=>{try{let Q="";const te=(await k.get({dir:"province",file:"short"})).filter(ne=>J({latitude:X,longitude:Y,address:[ne]}));let ie="";for(let ne=0;ne<te.length;ne++){const{id:oe}=te[ne],ce=await k.get({dir:"province",file:oe}),we=J({latitude:X,longitude:Y,address:[ce]});we&&(ie=we)}if(ie){Q=ie.id;const ne=await k.get({dir:"city",file:ie.id}),oe=J({latitude:X,longitude:Y,address:ne});if(oe){Q=oe.id;const ce=await k.get({dir:"district",file:oe.id}),we=J({latitude:X,longitude:Y,address:ce});we&&(Q=we.id)}}if(!Q)throw new Error("非中国境内");return Q}catch(Q){throw Q}}}},909:(O,I,o)=>{const k=o(218),{decompressFromEncodedURIComponent:N}=o(961),F=o(483),J=o(182),{version:X,fileDate:Y}=o(147);O.exports=new class{constructor(){this.local=null,this.localConfig={name:"pikazLocation",storeName:"v"+X.split(".")[0]+"."+X.split(".")[1]}}async get({dir:Q,file:te}){if(!this.local){const oe=F.createInstance(this.localConfig);await oe.ready(),this.local=oe}const ie=`${Q}-${te}-${Y[Q]}`,ne=await this.local.getItem(ie);if(ne)return ne;try{const oe=await(async({file:ce})=>{const we=k.CancelToken;let se;const ye=async(fe,pe)=>{const ve=await k({url:`${fe}/static/${pe}.json`,method:"get",dataType:"json",cancelToken:new we(function(me){se=me}),timeout:J.timeout});if(!ve||!ve.data||Object.prototype.toString.call(ve.data.s)!="[object String]")throw new Error("未获取到文件");const Te=N(ve.data.s);return JSON.parse(Te)};try{const fe=J.userCdn;if(fe)return await ye(fe,ce);throw new Error("未找到设置的url")}catch{const pe=J.cdn.map(ve=>new Promise(Te=>{ye(ve,ce).then(me=>{Te(me)}).catch(()=>{})}));try{return await Promise.race(pe)}catch{throw new Error("定位失败")}finally{se()}}})({file:`${Q}/${te}`});return this.local.setItem(ie,oe),oe}catch{throw new Error("定位失败")}}async getVal({key:Q,gainVal:te,expiration:ie}){if(!this.local){const ye=F.createInstance(this.localConfig);await ye.ready(),this.local=ye}const ne=new Date().getTime(),oe=ie||0,ce=`local-${Q}`,we=await this.local.getItem(ce);if(we&&we.expiration>ne)return we.val;const se=await te();return await this.local.setItem(ce,{val:se,expiration:ne+oe}),se}async clear(){await this.local.clear()}}},138:(O,I,o)=>{const k=o(182),{getGeo:N,getGeoCode:F}=o(955),{getList:J,searchCodeInfo:X,searchStrAddress:Y,searchCodeDetailInfo:Q}=o(946),{getIpCode:te}=o(454),ie=async(se,ye={})=>{let{timeout:fe}={...k.config,...ye};return await Promise.race([se(ye),new Promise((pe,ve)=>{setTimeout(()=>{ve(new Error("定位超时"))},fe)})])},ne=async(se={})=>{let{timeout:ye,enableHighAccuracy:fe,detail:pe,latitude:ve,longitude:Te}={...k.config,...se};if(!ve||!Te){const{latitude:me,longitude:_e}=await N({timeout:ye,enableHighAccuracy:fe});ve=me,Te=_e}return await ie(async()=>{const me=await F({latitude:ve,longitude:Te});if(!me)throw new Error("非中国境内");return{...await X({code:me,detail:pe}),latitude:ve,longitude:Te}},{timeout:ye})},oe=async(se={})=>{let{detail:ye,ip:fe}={...k.config,...se};const{code:pe,ip:ve}=await te({ip:fe});return fe||(fe=ve),{...await X({code:pe,detail:ye}),ip:fe}},ce=async(se={})=>{const{address:ye,detail:fe}={...k.config,...se},pe=await Y(ye);if(!pe)throw new Error("解析地址失败,请确认地址包含省级或市级名称");return await X({code:pe,detail:fe})},we=async(se={})=>{const{code:ye,detail:fe}={...k.config,...se};return await X({code:ye,detail:fe})};O.exports={setConfig:({timeout:se,url:ye})=>{k.set({timeout:se,url:ye})},getLocation:async(se={})=>{try{return{...await ne(se),type:"h5"}}catch{return{...await ie(oe,se),type:"ip"}}},getH5Location:ne,getIpLocation:se=>ie(oe,se),searchList:async(se={})=>{const{code:ye}={...se};return await J(ye||"")||[]},searchCodeAddress:se=>ie(we,se),searchAddress:se=>ie(ce,se),searchCodeDetail:se=>ie(Q,se)}},454:(O,I,o)=>{const{decompressFromEncodedURIComponent:k}=o(961),N=o(909),F=X=>{const Y=X.split(".").reduce((Q,te)=>`${Q}${(ie=>{const ne=ie.split("").reverse();return new Array(3).fill(0).map((oe,ce)=>ne[ce]||0).reverse().join("")})(te)}`,"");return Number(Y)},J=()=>new Promise((X,Y)=>{const Q="ipCallback"+new Date().getTime(),te=document.createElement("script");te.onerror=()=>{Y(new Error("获取ip失败"))},window[Q]=ie=>{ie&&ie.ip?X(ie.ip):Y(new Error("ip定位失败"))},te.src=k("BYFxAcGcC4HpYIbgJYDpkoGYE9UHsAnAc1gH5NCBbBEAXgCtI8A7cAMjYGMEAbHgIwScA1rSA")+Q,document.body.appendChild(te)});O.exports={addZero:F,getIpCode:async(X={})=>{let{ip:Y}={...X};Y||(Y=await N.getVal({key:"ip",gainVal:J,expiration:864e5}));const Q=Y.split(".").map(te=>Number(te)||0);if(Q.length!==4)throw new Error("ip格式错误,只支持ipv4");return{code:(await N.get({dir:"ip",file:`${Q[0]}.${Q[1]}`})).reduce((te,ie)=>{const{district:ne,id:oe}=ie,ce=F(Y);return ce>=ne[0]&&ce<=ne[1]?oe:te},""),ip:Y}}}},218:(O,I,o)=>{function k(ee,le){return function(){return ee.apply(le,arguments)}}const{toString:N}=Object.prototype,{getPrototypeOf:F}=Object,J=(X=Object.create(null),ee=>{const le=N.call(ee);return X[le]||(X[le]=le.slice(8,-1).toLowerCase())});var X;const Y=ee=>(ee=ee.toLowerCase(),le=>J(le)===ee),Q=ee=>le=>typeof le===ee,{isArray:te}=Array,ie=Q("undefined"),ne=Y("ArrayBuffer"),oe=Q("string"),ce=Q("function"),we=Q("number"),se=ee=>ee!==null&&typeof ee=="object",ye=ee=>{if(J(ee)!=="object")return!1;const le=F(ee);return!(le!==null&&le!==Object.prototype&&Object.getPrototypeOf(le)!==null||Symbol.toStringTag in ee||Symbol.iterator in ee)},fe=Y("Date"),pe=Y("File"),ve=Y("Blob"),Te=Y("FileList"),me=Y("URLSearchParams");function _e(ee,le,{allOwnKeys:be=!1}={}){if(ee==null)return;let ke,xe;if(typeof ee!="object"&&(ee=[ee]),te(ee))for(ke=0,xe=ee.length;ke<xe;ke++)le.call(null,ee[ke],ke,ee);else{const $e=be?Object.getOwnPropertyNames(ee):Object.keys(ee),Ce=$e.length;let We;for(ke=0;ke<Ce;ke++)We=$e[ke],le.call(null,ee[We],We,ee)}}function De(ee,le){le=le.toLowerCase();const be=Object.keys(ee);let ke,xe=be.length;for(;xe-- >0;)if(ke=be[xe],le===ke.toLowerCase())return ke;return null}const je=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:o.g,Fe=ee=>!ie(ee)&&ee!==je,qe=(gt=typeof Uint8Array<"u"&&F(Uint8Array),ee=>gt&&ee instanceof gt);var gt;const St=Y("HTMLFormElement"),It=(({hasOwnProperty:ee})=>(le,be)=>ee.call(le,be))(Object.prototype),Lt=Y("RegExp"),Nt=(ee,le)=>{const be=Object.getOwnPropertyDescriptors(ee),ke={};_e(be,(xe,$e)=>{let Ce;(Ce=le(xe,$e,ee))!==!1&&(ke[$e]=Ce||xe)}),Object.defineProperties(ee,ke)},yt="abcdefghijklmnopqrstuvwxyz",tt="0123456789",zt={DIGIT:tt,ALPHA:yt,ALPHA_DIGIT:yt+yt.toUpperCase()+tt},Ot=Y("AsyncFunction");var Ne={isArray:te,isArrayBuffer:ne,isBuffer:function(ee){return ee!==null&&!ie(ee)&&ee.constructor!==null&&!ie(ee.constructor)&&ce(ee.constructor.isBuffer)&&ee.constructor.isBuffer(ee)},isFormData:ee=>{let le;return ee&&(typeof FormData=="function"&&ee instanceof FormData||ce(ee.append)&&((le=J(ee))==="formdata"||le==="object"&&ce(ee.toString)&&ee.toString()==="[object FormData]"))},isArrayBufferView:function(ee){let le;return le=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ee):ee&&ee.buffer&&ne(ee.buffer),le},isString:oe,isNumber:we,isBoolean:ee=>ee===!0||ee===!1,isObject:se,isPlainObject:ye,isUndefined:ie,isDate:fe,isFile:pe,isBlob:ve,isRegExp:Lt,isFunction:ce,isStream:ee=>se(ee)&&ce(ee.pipe),isURLSearchParams:me,isTypedArray:qe,isFileList:Te,forEach:_e,merge:function ee(){const{caseless:le}=Fe(this)&&this||{},be={},ke=(xe,$e)=>{const Ce=le&&De(be,$e)||$e;ye(be[Ce])&&ye(xe)?be[Ce]=ee(be[Ce],xe):ye(xe)?be[Ce]=ee({},xe):te(xe)?be[Ce]=xe.slice():be[Ce]=xe};for(let xe=0,$e=arguments.length;xe<$e;xe++)arguments[xe]&&_e(arguments[xe],ke);return be},extend:(ee,le,be,{allOwnKeys:ke}={})=>(_e(le,(xe,$e)=>{be&&ce(xe)?ee[$e]=k(xe,be):ee[$e]=xe},{allOwnKeys:ke}),ee),trim:ee=>ee.trim?ee.trim():ee.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ee=>(ee.charCodeAt(0)===65279&&(ee=ee.slice(1)),ee),inherits:(ee,le,be,ke)=>{ee.prototype=Object.create(le.prototype,ke),ee.prototype.constructor=ee,Object.defineProperty(ee,"super",{value:le.prototype}),be&&Object.assign(ee.prototype,be)},toFlatObject:(ee,le,be,ke)=>{let xe,$e,Ce;const We={};if(le=le||{},ee==null)return le;do{for(xe=Object.getOwnPropertyNames(ee),$e=xe.length;$e-- >0;)Ce=xe[$e],ke&&!ke(Ce,ee,le)||We[Ce]||(le[Ce]=ee[Ce],We[Ce]=!0);ee=be!==!1&&F(ee)}while(ee&&(!be||be(ee,le))&&ee!==Object.prototype);return le},kindOf:J,kindOfTest:Y,endsWith:(ee,le,be)=>{ee=String(ee),(be===void 0||be>ee.length)&&(be=ee.length),be-=le.length;const ke=ee.indexOf(le,be);return ke!==-1&&ke===be},toArray:ee=>{if(!ee)return null;if(te(ee))return ee;let le=ee.length;if(!we(le))return null;const be=new Array(le);for(;le-- >0;)be[le]=ee[le];return be},forEachEntry:(ee,le)=>{const be=(ee&&ee[Symbol.iterator]).call(ee);let ke;for(;(ke=be.next())&&!ke.done;){const xe=ke.value;le.call(ee,xe[0],xe[1])}},matchAll:(ee,le)=>{let be;const ke=[];for(;(be=ee.exec(le))!==null;)ke.push(be);return ke},isHTMLForm:St,hasOwnProperty:It,hasOwnProp:It,reduceDescriptors:Nt,freezeMethods:ee=>{Nt(ee,(le,be)=>{if(ce(ee)&&["arguments","caller","callee"].indexOf(be)!==-1)return!1;const ke=ee[be];ce(ke)&&(le.enumerable=!1,"writable"in le?le.writable=!1:le.set||(le.set=()=>{throw Error("Can not rewrite read-only method '"+be+"'")}))})},toObjectSet:(ee,le)=>{const be={},ke=xe=>{xe.forEach($e=>{be[$e]=!0})};return te(ee)?ke(ee):ke(String(ee).split(le)),be},toCamelCase:ee=>ee.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(le,be,ke){return be.toUpperCase()+ke}),noop:()=>{},toFiniteNumber:(ee,le)=>(ee=+ee,Number.isFinite(ee)?ee:le),findKey:De,global:je,isContextDefined:Fe,ALPHABET:zt,generateString:(ee=16,le=zt.ALPHA_DIGIT)=>{let be="";const{length:ke}=le;for(;ee--;)be+=le[Math.random()*ke|0];return be},isSpecCompliantForm:function(ee){return!!(ee&&ce(ee.append)&&ee[Symbol.toStringTag]==="FormData"&&ee[Symbol.iterator])},toJSONObject:ee=>{const le=new Array(10),be=(ke,xe)=>{if(se(ke)){if(le.indexOf(ke)>=0)return;if(!("toJSON"in ke)){le[xe]=ke;const $e=te(ke)?[]:{};return _e(ke,(Ce,We)=>{const Ze=be(Ce,xe+1);!ie(Ze)&&($e[We]=Ze)}),le[xe]=void 0,$e}}return ke};return be(ee,0)},isAsyncFn:Ot,isThenable:ee=>ee&&(se(ee)||ce(ee))&&ce(ee.then)&&ce(ee.catch)};function nt(ee,le,be,ke,xe){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ee,this.name="AxiosError",le&&(this.code=le),be&&(this.config=be),ke&&(this.request=ke),xe&&(this.response=xe)}Ne.inherits(nt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ne.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ht=nt.prototype,At={};function et(ee){return Ne.isPlainObject(ee)||Ne.isArray(ee)}function Qe(ee){return Ne.endsWith(ee,"[]")?ee.slice(0,-2):ee}function rt(ee,le,be){return ee?ee.concat(le).map(function(ke,xe){return ke=Qe(ke),!be&&xe?"["+ke+"]":ke}).join(be?".":""):le}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ee=>{At[ee]={value:ee}}),Object.defineProperties(nt,At),Object.defineProperty(Ht,"isAxiosError",{value:!0}),nt.from=(ee,le,be,ke,xe,$e)=>{const Ce=Object.create(Ht);return Ne.toFlatObject(ee,Ce,function(We){return We!==Error.prototype},We=>We!=="isAxiosError"),nt.call(Ce,ee.message,le,be,ke,xe),Ce.cause=ee,Ce.name=ee.name,$e&&Object.assign(Ce,$e),Ce};const it=Ne.toFlatObject(Ne,{},null,function(ee){return/^is[A-Z]/.test(ee)});function vt(ee,le,be){if(!Ne.isObject(ee))throw new TypeError("target must be an object");le=le||new FormData;const ke=(be=Ne.toFlatObject(be,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ke,bt){return!Ne.isUndefined(bt[Ke])})).metaTokens,xe=be.visitor||Je,$e=be.dots,Ce=be.indexes,We=(be.Blob||typeof Blob<"u"&&Blob)&&Ne.isSpecCompliantForm(le);if(!Ne.isFunction(xe))throw new TypeError("visitor must be a function");function Ze(Ke){if(Ke===null)return"";if(Ne.isDate(Ke))return Ke.toISOString();if(!We&&Ne.isBlob(Ke))throw new nt("Blob is not supported. Use a Buffer instead.");return Ne.isArrayBuffer(Ke)||Ne.isTypedArray(Ke)?We&&typeof Blob=="function"?new Blob([Ke]):Buffer.from(Ke):Ke}function Je(Ke,bt,Ge){let kt=Ke;if(Ke&&!Ge&&typeof Ke=="object"){if(Ne.endsWith(bt,"{}"))bt=ke?bt:bt.slice(0,-2),Ke=JSON.stringify(Ke);else if(Ne.isArray(Ke)&&function(Pt){return Ne.isArray(Pt)&&!Pt.some(et)}(Ke)||(Ne.isFileList(Ke)||Ne.endsWith(bt,"[]"))&&(kt=Ne.toArray(Ke)))return bt=Qe(bt),kt.forEach(function(Pt,nn){!Ne.isUndefined(Pt)&&Pt!==null&&le.append(Ce===!0?rt([bt],nn,$e):Ce===null?bt:bt+"[]",Ze(Pt))}),!1}return!!et(Ke)||(le.append(rt(Ge,bt,$e),Ze(Ke)),!1)}const Le=[],st=Object.assign(it,{defaultVisitor:Je,convertValue:Ze,isVisitable:et});if(!Ne.isObject(ee))throw new TypeError("data must be an object");return function Ke(bt,Ge){if(!Ne.isUndefined(bt)){if(Le.indexOf(bt)!==-1)throw Error("Circular reference detected in "+Ge.join("."));Le.push(bt),Ne.forEach(bt,function(kt,Pt){(!(Ne.isUndefined(kt)||kt===null)&&xe.call(le,kt,Ne.isString(Pt)?Pt.trim():Pt,Ge,st))===!0&&Ke(kt,Ge?Ge.concat(Pt):[Pt])}),Le.pop()}}(ee),le}function Rt(ee){const le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ee).replace(/[!'()~]|%20|%00/g,function(be){return le[be]})}function Mt(ee,le){this._pairs=[],ee&&vt(ee,this,le)}const qt=Mt.prototype;function Jt(ee){return encodeURIComponent(ee).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Wt(ee,le,be){if(!le)return ee;const ke=be&&be.encode||Jt,xe=be&&be.serialize;let $e;if($e=xe?xe(le,be):Ne.isURLSearchParams(le)?le.toString():new Mt(le,be).toString(ke),$e){const Ce=ee.indexOf("#");Ce!==-1&&(ee=ee.slice(0,Ce)),ee+=(ee.indexOf("?")===-1?"?":"&")+$e}return ee}qt.append=function(ee,le){this._pairs.push([ee,le])},qt.toString=function(ee){const le=ee?function(be){return ee.call(this,be,Rt)}:Rt;return this._pairs.map(function(be){return le(be[0])+"="+le(be[1])},"").join("&")};var cn=class{constructor(){this.handlers=[]}use(ee,le,be){return this.handlers.push({fulfilled:ee,rejected:le,synchronous:!!be&&be.synchronous,runWhen:be?be.runWhen:null}),this.handlers.length-1}eject(ee){this.handlers[ee]&&(this.handlers[ee]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ee){Ne.forEach(this.handlers,function(le){le!==null&&ee(le)})}},Yt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Mt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};const jt=typeof window<"u"&&typeof document<"u",Vt=(yn=typeof navigator<"u"&&navigator.product,jt&&["ReactNative","NativeScript","NS"].indexOf(yn)<0);var yn;const en=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Zt={...Object.freeze({__proto__:null,hasBrowserEnv:jt,hasStandardBrowserWebWorkerEnv:en,hasStandardBrowserEnv:Vt}),...Xt};function re(ee){function le(be,ke,xe,$e){let Ce=be[$e++];const We=Number.isFinite(+Ce),Ze=$e>=be.length;return Ce=!Ce&&Ne.isArray(xe)?xe.length:Ce,Ze?(Ne.hasOwnProp(xe,Ce)?xe[Ce]=[xe[Ce],ke]:xe[Ce]=ke,!We):(xe[Ce]&&Ne.isObject(xe[Ce])||(xe[Ce]=[]),le(be,ke,xe[Ce],$e)&&Ne.isArray(xe[Ce])&&(xe[Ce]=function(Je){const Le={},st=Object.keys(Je);let Ke;const bt=st.length;let Ge;for(Ke=0;Ke<bt;Ke++)Ge=st[Ke],Le[Ge]=Je[Ge];return Le}(xe[Ce])),!We)}if(Ne.isFormData(ee)&&Ne.isFunction(ee.entries)){const be={};return Ne.forEachEntry(ee,(ke,xe)=>{le(function($e){return Ne.matchAll(/\w+|\[(\w*)]/g,$e).map(Ce=>Ce[0]==="[]"?"":Ce[1]||Ce[0])}(ke),xe,be,0)}),be}return null}const Z={transitional:Yt,adapter:["xhr","http"],transformRequest:[function(ee,le){const be=le.getContentType()||"",ke=be.indexOf("application/json")>-1,xe=Ne.isObject(ee);if(xe&&Ne.isHTMLForm(ee)&&(ee=new FormData(ee)),Ne.isFormData(ee))return ke&&ke?JSON.stringify(re(ee)):ee;if(Ne.isArrayBuffer(ee)||Ne.isBuffer(ee)||Ne.isStream(ee)||Ne.isFile(ee)||Ne.isBlob(ee))return ee;if(Ne.isArrayBufferView(ee))return ee.buffer;if(Ne.isURLSearchParams(ee))return le.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ee.toString();let $e;if(xe){if(be.indexOf("application/x-www-form-urlencoded")>-1)return function(Ce,We){return vt(Ce,new Zt.classes.URLSearchParams,Object.assign({visitor:function(Ze,Je,Le,st){return Zt.isNode&&Ne.isBuffer(Ze)?(this.append(Je,Ze.toString("base64")),!1):st.defaultVisitor.apply(this,arguments)}},We))}(ee,this.formSerializer).toString();if(($e=Ne.isFileList(ee))||be.indexOf("multipart/form-data")>-1){const Ce=this.env&&this.env.FormData;return vt($e?{"files[]":ee}:ee,Ce&&new Ce,this.formSerializer)}}return xe||ke?(le.setContentType("application/json",!1),function(Ce,We,Ze){if(Ne.isString(Ce))try{return(0,JSON.parse)(Ce),Ne.trim(Ce)}catch(Je){if(Je.name!=="SyntaxError")throw Je}return(0,JSON.stringify)(Ce)}(ee)):ee}],transformResponse:[function(ee){const le=this.transitional||Z.transitional,be=le&&le.forcedJSONParsing,ke=this.responseType==="json";if(ee&&Ne.isString(ee)&&(be&&!this.responseType||ke)){const xe=!(le&&le.silentJSONParsing)&&ke;try{return JSON.parse(ee)}catch($e){if(xe)throw $e.name==="SyntaxError"?nt.from($e,nt.ERR_BAD_RESPONSE,this,null,this.response):$e}}return ee}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zt.classes.FormData,Blob:Zt.classes.Blob},validateStatus:function(ee){return ee>=200&&ee<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ne.forEach(["delete","get","head","post","put","patch"],ee=>{Z.headers[ee]={}});var K=Z;const ue=Ne.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ge=Symbol("internals");function Ae(ee){return ee&&String(ee).trim().toLowerCase()}function Me(ee){return ee===!1||ee==null?ee:Ne.isArray(ee)?ee.map(Me):String(ee)}function ot(ee,le,be,ke,xe){return Ne.isFunction(ke)?ke.call(this,le,be):(xe&&(le=be),Ne.isString(le)?Ne.isString(ke)?le.indexOf(ke)!==-1:Ne.isRegExp(ke)?ke.test(le):void 0:void 0)}class _t{constructor(le){le&&this.set(le)}set(le,be,ke){const xe=this;function $e(We,Ze,Je){const Le=Ae(Ze);if(!Le)throw new Error("header name must be a non-empty string");const st=Ne.findKey(xe,Le);(!st||xe[st]===void 0||Je===!0||Je===void 0&&xe[st]!==!1)&&(xe[st||Ze]=Me(We))}const Ce=(We,Ze)=>Ne.forEach(We,(Je,Le)=>$e(Je,Le,Ze));return Ne.isPlainObject(le)||le instanceof this.constructor?Ce(le,be):Ne.isString(le)&&(le=le.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(le.trim())?Ce((We=>{const Ze={};let Je,Le,st;return We&&We.split(`
|
|
4
|
+
`).forEach(function(Ke){st=Ke.indexOf(":"),Je=Ke.substring(0,st).trim().toLowerCase(),Le=Ke.substring(st+1).trim(),!Je||Ze[Je]&&ue[Je]||(Je==="set-cookie"?Ze[Je]?Ze[Je].push(Le):Ze[Je]=[Le]:Ze[Je]=Ze[Je]?Ze[Je]+", "+Le:Le)}),Ze})(le),be):le!=null&&$e(be,le,ke),this}get(le,be){if(le=Ae(le)){const ke=Ne.findKey(this,le);if(ke){const xe=this[ke];if(!be)return xe;if(be===!0)return function($e){const Ce=Object.create(null),We=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let Ze;for(;Ze=We.exec($e);)Ce[Ze[1]]=Ze[2];return Ce}(xe);if(Ne.isFunction(be))return be.call(this,xe,ke);if(Ne.isRegExp(be))return be.exec(xe);throw new TypeError("parser must be boolean|regexp|function")}}}has(le,be){if(le=Ae(le)){const ke=Ne.findKey(this,le);return!(!ke||this[ke]===void 0||be&&!ot(0,this[ke],ke,be))}return!1}delete(le,be){const ke=this;let xe=!1;function $e(Ce){if(Ce=Ae(Ce)){const We=Ne.findKey(ke,Ce);!We||be&&!ot(0,ke[We],We,be)||(delete ke[We],xe=!0)}}return Ne.isArray(le)?le.forEach($e):$e(le),xe}clear(le){const be=Object.keys(this);let ke=be.length,xe=!1;for(;ke--;){const $e=be[ke];le&&!ot(0,this[$e],$e,le,!0)||(delete this[$e],xe=!0)}return xe}normalize(le){const be=this,ke={};return Ne.forEach(this,(xe,$e)=>{const Ce=Ne.findKey(ke,$e);if(Ce)return be[Ce]=Me(xe),void delete be[$e];const We=le?function(Ze){return Ze.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Je,Le,st)=>Le.toUpperCase()+st)}($e):String($e).trim();We!==$e&&delete be[$e],be[We]=Me(xe),ke[We]=!0}),this}concat(...le){return this.constructor.concat(this,...le)}toJSON(le){const be=Object.create(null);return Ne.forEach(this,(ke,xe)=>{ke!=null&&ke!==!1&&(be[xe]=le&&Ne.isArray(ke)?ke.join(", "):ke)}),be}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([le,be])=>le+": "+be).join(`
|
|
5
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(le){return le instanceof this?le:new this(le)}static concat(le,...be){const ke=new this(le);return be.forEach(xe=>ke.set(xe)),ke}static accessor(le){const be=(this[ge]=this[ge]={accessors:{}}).accessors,ke=this.prototype;function xe($e){const Ce=Ae($e);be[Ce]||(function(We,Ze){const Je=Ne.toCamelCase(" "+Ze);["get","set","has"].forEach(Le=>{Object.defineProperty(We,Le+Je,{value:function(st,Ke,bt){return this[Le].call(this,Ze,st,Ke,bt)},configurable:!0})})}(ke,$e),be[Ce]=!0)}return Ne.isArray(le)?le.forEach(xe):xe(le),this}}_t.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ne.reduceDescriptors(_t.prototype,({value:ee},le)=>{let be=le[0].toUpperCase()+le.slice(1);return{get:()=>ee,set(ke){this[be]=ke}}}),Ne.freezeMethods(_t);var ut=_t;function Tt(ee,le){const be=this||K,ke=le||be,xe=ut.from(ke.headers);let $e=ke.data;return Ne.forEach(ee,function(Ce){$e=Ce.call(be,$e,xe.normalize(),le?le.status:void 0)}),xe.normalize(),$e}function wt(ee){return!(!ee||!ee.__CANCEL__)}function ln(ee,le,be){nt.call(this,ee??"canceled",nt.ERR_CANCELED,le,be),this.name="CanceledError"}Ne.inherits(ln,nt,{__CANCEL__:!0});var Qn=Zt.hasStandardBrowserEnv?{write(ee,le,be,ke,xe,$e){const Ce=[ee+"="+encodeURIComponent(le)];Ne.isNumber(be)&&Ce.push("expires="+new Date(be).toGMTString()),Ne.isString(ke)&&Ce.push("path="+ke),Ne.isString(xe)&&Ce.push("domain="+xe),$e===!0&&Ce.push("secure"),document.cookie=Ce.join("; ")},read(ee){const le=document.cookie.match(new RegExp("(^|;\\s*)("+ee+")=([^;]*)"));return le?decodeURIComponent(le[3]):null},remove(ee){this.write(ee,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Kn(ee,le){return ee&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(le)?function(be,ke){return ke?be.replace(/\/+$/,"")+"/"+ke.replace(/^\/+/,""):be}(ee,le):le}var ae=Zt.hasStandardBrowserEnv?function(){const ee=/(msie|trident)/i.test(navigator.userAgent),le=document.createElement("a");let be;function ke(xe){let $e=xe;return ee&&(le.setAttribute("href",$e),$e=le.href),le.setAttribute("href",$e),{href:le.href,protocol:le.protocol?le.protocol.replace(/:$/,""):"",host:le.host,search:le.search?le.search.replace(/^\?/,""):"",hash:le.hash?le.hash.replace(/^#/,""):"",hostname:le.hostname,port:le.port,pathname:le.pathname.charAt(0)==="/"?le.pathname:"/"+le.pathname}}return be=ke(window.location.href),function(xe){const $e=Ne.isString(xe)?ke(xe):xe;return $e.protocol===be.protocol&&$e.host===be.host}}():function(){return!0};function de(ee,le){let be=0;const ke=function(xe,$e){xe=xe||10;const Ce=new Array(xe),We=new Array(xe);let Ze,Je=0,Le=0;return $e=$e!==void 0?$e:1e3,function(st){const Ke=Date.now(),bt=We[Le];Ze||(Ze=Ke),Ce[Je]=st,We[Je]=Ke;let Ge=Le,kt=0;for(;Ge!==Je;)kt+=Ce[Ge++],Ge%=xe;if(Je=(Je+1)%xe,Je===Le&&(Le=(Le+1)%xe),Ke-Ze<$e)return;const Pt=bt&&Ke-bt;return Pt?Math.round(1e3*kt/Pt):void 0}}(50,250);return xe=>{const $e=xe.loaded,Ce=xe.lengthComputable?xe.total:void 0,We=$e-be,Ze=ke(We);be=$e;const Je={loaded:$e,total:Ce,progress:Ce?$e/Ce:void 0,bytes:We,rate:Ze||void 0,estimated:Ze&&Ce&&$e<=Ce?(Ce-$e)/Ze:void 0,event:xe};Je[le?"download":"upload"]=!0,ee(Je)}}const he={http:null,xhr:typeof XMLHttpRequest<"u"&&function(ee){return new Promise(function(le,be){let ke=ee.data;const xe=ut.from(ee.headers).normalize();let $e,Ce,{responseType:We,withXSRFToken:Ze}=ee;function Je(){ee.cancelToken&&ee.cancelToken.unsubscribe($e),ee.signal&&ee.signal.removeEventListener("abort",$e)}if(Ne.isFormData(ke)){if(Zt.hasStandardBrowserEnv||Zt.hasStandardBrowserWebWorkerEnv)xe.setContentType(!1);else if((Ce=xe.getContentType())!==!1){const[Ge,...kt]=Ce?Ce.split(";").map(Pt=>Pt.trim()).filter(Boolean):[];xe.setContentType([Ge||"multipart/form-data",...kt].join("; "))}}let Le=new XMLHttpRequest;if(ee.auth){const Ge=ee.auth.username||"",kt=ee.auth.password?unescape(encodeURIComponent(ee.auth.password)):"";xe.set("Authorization","Basic "+btoa(Ge+":"+kt))}const st=Kn(ee.baseURL,ee.url);function Ke(){if(!Le)return;const Ge=ut.from("getAllResponseHeaders"in Le&&Le.getAllResponseHeaders());(function(kt,Pt,nn){const Xn=nn.config.validateStatus;nn.status&&Xn&&!Xn(nn.status)?Pt(new nt("Request failed with status code "+nn.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(nn.status/100)-4],nn.config,nn.request,nn)):kt(nn)})(function(kt){le(kt),Je()},function(kt){be(kt),Je()},{data:We&&We!=="text"&&We!=="json"?Le.response:Le.responseText,status:Le.status,statusText:Le.statusText,headers:Ge,config:ee,request:Le}),Le=null}if(Le.open(ee.method.toUpperCase(),Wt(st,ee.params,ee.paramsSerializer),!0),Le.timeout=ee.timeout,"onloadend"in Le?Le.onloadend=Ke:Le.onreadystatechange=function(){Le&&Le.readyState===4&&(Le.status!==0||Le.responseURL&&Le.responseURL.indexOf("file:")===0)&&setTimeout(Ke)},Le.onabort=function(){Le&&(be(new nt("Request aborted",nt.ECONNABORTED,ee,Le)),Le=null)},Le.onerror=function(){be(new nt("Network Error",nt.ERR_NETWORK,ee,Le)),Le=null},Le.ontimeout=function(){let Ge=ee.timeout?"timeout of "+ee.timeout+"ms exceeded":"timeout exceeded";const kt=ee.transitional||Yt;ee.timeoutErrorMessage&&(Ge=ee.timeoutErrorMessage),be(new nt(Ge,kt.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,ee,Le)),Le=null},Zt.hasStandardBrowserEnv&&(Ze&&Ne.isFunction(Ze)&&(Ze=Ze(ee)),Ze||Ze!==!1&&ae(st))){const Ge=ee.xsrfHeaderName&&ee.xsrfCookieName&&Qn.read(ee.xsrfCookieName);Ge&&xe.set(ee.xsrfHeaderName,Ge)}ke===void 0&&xe.setContentType(null),"setRequestHeader"in Le&&Ne.forEach(xe.toJSON(),function(Ge,kt){Le.setRequestHeader(kt,Ge)}),Ne.isUndefined(ee.withCredentials)||(Le.withCredentials=!!ee.withCredentials),We&&We!=="json"&&(Le.responseType=ee.responseType),typeof ee.onDownloadProgress=="function"&&Le.addEventListener("progress",de(ee.onDownloadProgress,!0)),typeof ee.onUploadProgress=="function"&&Le.upload&&Le.upload.addEventListener("progress",de(ee.onUploadProgress)),(ee.cancelToken||ee.signal)&&($e=Ge=>{Le&&(be(!Ge||Ge.type?new ln(null,ee,Le):Ge),Le.abort(),Le=null)},ee.cancelToken&&ee.cancelToken.subscribe($e),ee.signal&&(ee.signal.aborted?$e():ee.signal.addEventListener("abort",$e)));const bt=function(Ge){const kt=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Ge);return kt&&kt[1]||""}(st);bt&&Zt.protocols.indexOf(bt)===-1?be(new nt("Unsupported protocol "+bt+":",nt.ERR_BAD_REQUEST,ee)):Le.send(ke||null)})}};Ne.forEach(he,(ee,le)=>{if(ee){try{Object.defineProperty(ee,"name",{value:le})}catch{}Object.defineProperty(ee,"adapterName",{value:le})}});const Ee=ee=>`- ${ee}`,Oe=ee=>Ne.isFunction(ee)||ee===null||ee===!1;var Ie=ee=>{ee=Ne.isArray(ee)?ee:[ee];const{length:le}=ee;let be,ke;const xe={};for(let $e=0;$e<le;$e++){let Ce;if(be=ee[$e],ke=be,!Oe(be)&&(ke=he[(Ce=String(be)).toLowerCase()],ke===void 0))throw new nt(`Unknown adapter '${Ce}'`);if(ke)break;xe[Ce||"#"+$e]=ke}if(!ke){const $e=Object.entries(xe).map(([Ce,We])=>`adapter ${Ce} `+(We===!1?"is not supported by the environment":"is not available in the build"));throw new nt("There is no suitable adapter to dispatch the request "+(le?$e.length>1?`since :
|
|
6
|
+
`+$e.map(Ee).join(`
|
|
7
|
+
`):" "+Ee($e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return ke};function Be(ee){if(ee.cancelToken&&ee.cancelToken.throwIfRequested(),ee.signal&&ee.signal.aborted)throw new ln(null,ee)}function Ue(ee){return Be(ee),ee.headers=ut.from(ee.headers),ee.data=Tt.call(ee,ee.transformRequest),["post","put","patch"].indexOf(ee.method)!==-1&&ee.headers.setContentType("application/x-www-form-urlencoded",!1),Ie(ee.adapter||K.adapter)(ee).then(function(le){return Be(ee),le.data=Tt.call(ee,ee.transformResponse,le),le.headers=ut.from(le.headers),le},function(le){return wt(le)||(Be(ee),le&&le.response&&(le.response.data=Tt.call(ee,ee.transformResponse,le.response),le.response.headers=ut.from(le.response.headers))),Promise.reject(le)})}const He=ee=>ee instanceof ut?ee.toJSON():ee;function Pe(ee,le){le=le||{};const be={};function ke(Je,Le,st){return Ne.isPlainObject(Je)&&Ne.isPlainObject(Le)?Ne.merge.call({caseless:st},Je,Le):Ne.isPlainObject(Le)?Ne.merge({},Le):Ne.isArray(Le)?Le.slice():Le}function xe(Je,Le,st){return Ne.isUndefined(Le)?Ne.isUndefined(Je)?void 0:ke(void 0,Je,st):ke(Je,Le,st)}function $e(Je,Le){if(!Ne.isUndefined(Le))return ke(void 0,Le)}function Ce(Je,Le){return Ne.isUndefined(Le)?Ne.isUndefined(Je)?void 0:ke(void 0,Je):ke(void 0,Le)}function We(Je,Le,st){return st in le?ke(Je,Le):st in ee?ke(void 0,Je):void 0}const Ze={url:$e,method:$e,data:$e,baseURL:Ce,transformRequest:Ce,transformResponse:Ce,paramsSerializer:Ce,timeout:Ce,timeoutMessage:Ce,withCredentials:Ce,withXSRFToken:Ce,adapter:Ce,responseType:Ce,xsrfCookieName:Ce,xsrfHeaderName:Ce,onUploadProgress:Ce,onDownloadProgress:Ce,decompress:Ce,maxContentLength:Ce,maxBodyLength:Ce,beforeRedirect:Ce,transport:Ce,httpAgent:Ce,httpsAgent:Ce,cancelToken:Ce,socketPath:Ce,responseEncoding:Ce,validateStatus:We,headers:(Je,Le)=>xe(He(Je),He(Le),!0)};return Ne.forEach(Object.keys(Object.assign({},ee,le)),function(Je){const Le=Ze[Je]||xe,st=Le(ee[Je],le[Je],Je);Ne.isUndefined(st)&&Le!==We||(be[Je]=st)}),be}const ze={};["object","boolean","number","function","string","symbol"].forEach((ee,le)=>{ze[ee]=function(be){return typeof be===ee||"a"+(le<1?"n ":" ")+ee}});const Ve={};ze.transitional=function(ee,le,be){function ke(xe,$e){return"[Axios v1.6.2] Transitional option '"+xe+"'"+$e+(be?". "+be:"")}return(xe,$e,Ce)=>{if(ee===!1)throw new nt(ke($e," has been removed"+(le?" in "+le:"")),nt.ERR_DEPRECATED);return le&&!Ve[$e]&&(Ve[$e]=!0,console.warn(ke($e," has been deprecated since v"+le+" and will be removed in the near future"))),!ee||ee(xe,$e,Ce)}};var Ye={assertOptions:function(ee,le,be){if(typeof ee!="object")throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const ke=Object.keys(ee);let xe=ke.length;for(;xe-- >0;){const $e=ke[xe],Ce=le[$e];if(Ce){const We=ee[$e],Ze=We===void 0||Ce(We,$e,ee);if(Ze!==!0)throw new nt("option "+$e+" must be "+Ze,nt.ERR_BAD_OPTION_VALUE)}else if(be!==!0)throw new nt("Unknown option "+$e,nt.ERR_BAD_OPTION)}},validators:ze};const at=Ye.validators;class ft{constructor(le){this.defaults=le,this.interceptors={request:new cn,response:new cn}}request(le,be){typeof le=="string"?(be=be||{}).url=le:be=le||{},be=Pe(this.defaults,be);const{transitional:ke,paramsSerializer:xe,headers:$e}=be;ke!==void 0&&Ye.assertOptions(ke,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),xe!=null&&(Ne.isFunction(xe)?be.paramsSerializer={serialize:xe}:Ye.assertOptions(xe,{encode:at.function,serialize:at.function},!0)),be.method=(be.method||this.defaults.method||"get").toLowerCase();let Ce=$e&&Ne.merge($e.common,$e[be.method]);$e&&Ne.forEach(["delete","get","head","post","put","patch","common"],Ge=>{delete $e[Ge]}),be.headers=ut.concat(Ce,$e);const We=[];let Ze=!0;this.interceptors.request.forEach(function(Ge){typeof Ge.runWhen=="function"&&Ge.runWhen(be)===!1||(Ze=Ze&&Ge.synchronous,We.unshift(Ge.fulfilled,Ge.rejected))});const Je=[];let Le;this.interceptors.response.forEach(function(Ge){Je.push(Ge.fulfilled,Ge.rejected)});let st,Ke=0;if(!Ze){const Ge=[Ue.bind(this),void 0];for(Ge.unshift.apply(Ge,We),Ge.push.apply(Ge,Je),st=Ge.length,Le=Promise.resolve(be);Ke<st;)Le=Le.then(Ge[Ke++],Ge[Ke++]);return Le}st=We.length;let bt=be;for(Ke=0;Ke<st;){const Ge=We[Ke++],kt=We[Ke++];try{bt=Ge(bt)}catch(Pt){kt.call(this,Pt);break}}try{Le=Ue.call(this,bt)}catch(Ge){return Promise.reject(Ge)}for(Ke=0,st=Je.length;Ke<st;)Le=Le.then(Je[Ke++],Je[Ke++]);return Le}getUri(le){return Wt(Kn((le=Pe(this.defaults,le)).baseURL,le.url),le.params,le.paramsSerializer)}}Ne.forEach(["delete","get","head","options"],function(ee){ft.prototype[ee]=function(le,be){return this.request(Pe(be||{},{method:ee,url:le,data:(be||{}).data}))}}),Ne.forEach(["post","put","patch"],function(ee){function le(be){return function(ke,xe,$e){return this.request(Pe($e||{},{method:ee,headers:be?{"Content-Type":"multipart/form-data"}:{},url:ke,data:xe}))}}ft.prototype[ee]=le(),ft.prototype[ee+"Form"]=le(!0)});var Dt=ft;class tn{constructor(le){if(typeof le!="function")throw new TypeError("executor must be a function.");let be;this.promise=new Promise(function(xe){be=xe});const ke=this;this.promise.then(xe=>{if(!ke._listeners)return;let $e=ke._listeners.length;for(;$e-- >0;)ke._listeners[$e](xe);ke._listeners=null}),this.promise.then=xe=>{let $e;const Ce=new Promise(We=>{ke.subscribe(We),$e=We}).then(xe);return Ce.cancel=function(){ke.unsubscribe($e)},Ce},le(function(xe,$e,Ce){ke.reason||(ke.reason=new ln(xe,$e,Ce),be(ke.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(le){this.reason?le(this.reason):this._listeners?this._listeners.push(le):this._listeners=[le]}unsubscribe(le){if(!this._listeners)return;const be=this._listeners.indexOf(le);be!==-1&&this._listeners.splice(be,1)}static source(){let le;return{token:new tn(function(be){le=be}),cancel:le}}}var vn=tn;const Cn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cn).forEach(([ee,le])=>{Cn[le]=ee});var Yn=Cn;const Ct=function ee(le){const be=new Dt(le),ke=k(Dt.prototype.request,be);return Ne.extend(ke,Dt.prototype,be,{allOwnKeys:!0}),Ne.extend(ke,be,null,{allOwnKeys:!0}),ke.create=function(xe){return ee(Pe(le,xe))},ke}(K);Ct.Axios=Dt,Ct.CanceledError=ln,Ct.CancelToken=vn,Ct.isCancel=wt,Ct.VERSION="1.6.2",Ct.toFormData=vt,Ct.AxiosError=nt,Ct.Cancel=Ct.CanceledError,Ct.all=function(ee){return Promise.all(ee)},Ct.spread=function(ee){return function(le){return ee.apply(null,le)}},Ct.isAxiosError=function(ee){return Ne.isObject(ee)&&ee.isAxiosError===!0},Ct.mergeConfig=Pe,Ct.AxiosHeaders=ut,Ct.formToJSON=ee=>re(Ne.isHTMLForm(ee)?new FormData(ee):ee),Ct.getAdapter=Ie,Ct.HttpStatusCode=Yn,Ct.default=Ct,O.exports=Ct},147:O=>{O.exports=JSON.parse('{"name":"@pikaz/location","version":"1.0.9","description":"used to obtain location from the browser","private":false,"main":"lib/pikazLocation.js","module":"lib/pikazLocationModule.js","scripts":{"compress":"node utils/compress.js","analysisip":"node utils/analysisIp.js","build":"webpack && webpack --config module.config.js"},"keywords":["geolocation","location","longitude","latitude","province","city","district"],"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/pikaz-18/pikaz-location.git"},"author":"pikaz","license":"MIT","bugs":{"url":"https://github.com/pikaz-18/pikaz-location/issues"},"homepage":"https://github.com/pikaz-18/pikaz-location#readme","devDependencies":{"clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^10.2.0","object-hash":"^3.0.0","webpack":"^5.65.0","webpack-cli":"^4.9.1"},"dependencies":{"axios":"^1.6.2","localforage":"^1.10.0","lz-string":"^1.4.4","point-in-polygon":"^1.1.0"},"fileDate":{"areaList":"202212301139","city":"202212301139","district":"202212301139","ip":"2024532110","province":"202317042"},"fileCode":{"areaList":"64b5a33f94b14ae208fca152fdc89dca1048360a","city":"7827eb2bc906b83df109ab24242ce68f98f9558b","district":"14d77ce6236e2025a4b1e3900cc70d0c32a62d0b","ip":"befa0a8a45fdc238a0fb4e4a3011dae43a06c1b4","province":"629a3c20a32e0de95e0633e0385234e2b7886c2d"}}')}},D={};function j(O){var I=D[O];if(I!==void 0)return I.exports;var o=D[O]={exports:{}};return z[O](o,o.exports,j),o.exports}return j.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),j(138)})()}},t$1={};function n$1($){var z=t$1[$];if(z!==void 0)return z.exports;var D=t$1[$]={exports:{}};return e$2[$].call(D.exports,D,D.exports,n$1),D.exports}n$1.n=$=>{var z=$&&$.__esModule?()=>$.default:()=>$;return n$1.d(z,{a:z}),z},n$1.d=($,z)=>{for(var D in z)n$1.o(z,D)&&!n$1.o($,D)&&Object.defineProperty($,D,{enumerable:!0,get:z[D]})},n$1.o=($,z)=>Object.prototype.hasOwnProperty.call($,z);var r={};(()=>{n$1.d(r,{v6:()=>$.setConfig,k$:()=>$.getLocation,SG:()=>$.getH5Location,Qf:()=>$.getIpLocation,Mc:()=>$.searchList,kr:()=>$.searchCodeAddress,Gp:()=>$.searchAddress,I5:()=>$.searchCodeDetail,ZP:()=>z});var $=n$1(782);const z={setConfig:$.setConfig,getLocation:$.getLocation,getH5Location:$.getH5Location,getIpLocation:$.getIpLocation,searchList:$.searchList,searchCodeAddress:$.searchCodeAddress,searchAddress:$.searchAddress,searchCodeDetail:$.searchCodeDetail}})(),r.ZP,r.SG,r.Qf,r.k$,r.Gp,r.kr,r.I5,r.Mc,r.v6;const createMutedAudioStream=$=>{const z=$.createOscillator();z.type="sine",z.frequency.setValueAtTime(0,$.currentTime);const D=$.createGain();D.gain.value=0,z.connect(D),D.connect($.destination),z.start();const j=$.createMediaStreamDestination();return D.disconnect(),z.connect(j),j.stream},createFakeVideoStream=($=10,z=10,D=30)=>{const j=document.createElement("canvas"),O=j.getContext("2d");j.width=$,j.height=z;let I=0;return setInterval(()=>{O.clearRect(0,0,j.width,j.height);const N=O.createLinearGradient(0,0,j.width,j.height);N.addColorStop(0,`hsla(${I}, 100%, 50%, 0)`),N.addColorStop(1,`hsla(${I+120}, 100%, 50%, 0)`),O.fillStyle=N,O.fillRect(0,0,j.width,j.height),I=(I+1)%360},100),j.captureStream(D)};class NetworkQualityTester{constructor(z=[]){Se(this,"targetUrls",[]);Se(this,"results",[]);z.length===0&&z.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=z,this.results=[]}async testAll(){const z=this.targetUrls.map(D=>this.testUrl(D));return await Promise.all(z),this.analyzeResults()}async testUrl(z){const D=performance.now();let j=0,O=!1;try{await fetch(z,{method:"HEAD",cache:"no-store"});const I=performance.now()-D,o=performance.now(),N=await(await fetch(z,{cache:"no-store"})).blob(),F=performance.now()-o;j=N.size,O=!0,this.results.push({url:z,success:O,headTime:I,getTime:F,size:j,downloadSpeed:j>0?(j/1024/(F/1e3)).toFixed(2):0,totalTime:performance.now()-D})}catch(I){this.results.push({url:z,success:!1,error:I.message,totalTime:performance.now()-D})}}analyzeResults(){const z=this.results.filter(I=>I.success);if(z.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const D=z.reduce((I,o)=>I+o.size,0),j=z.reduce((I,o)=>I+o.totalTime,0),O=z.reduce((I,o)=>I+parseFloat(o.downloadSpeed),0)/z.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:z.length,averageDownloadSpeed:`${O.toFixed(2)} KB/s`,averageResponseTime:`${(j/z.length).toFixed(2)}ms`,totalDataTransferred:`${(D/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($){(function(z){var D="undefined",j=D!==typeof Buffer&&Buffer,O=D!==typeof Uint8Array&&Uint8Array,I=D!==typeof ArrayBuffer&&ArrayBuffer,o=[0,0,0,0,0,0,0,0],k=Array.isArray||fe,N=4294967296,F=16777216,J;X("Uint64BE",!0,!0),X("Int64BE",!0,!1),X("Uint64LE",!1,!0),X("Int64LE",!1,!1);function X(pe,ve,Te){var me=ve?0:4,_e=ve?4:0,De=ve?0:3,je=ve?1:2,Fe=ve?2:1,qe=ve?3:0,gt=ve?ce:se,St=ve?we:ye,It=yt.prototype,Lt="is"+pe,Nt="_"+Lt;return It.buffer=void 0,It.offset=0,It[Nt]=!0,It.toNumber=Ne,It.toString=nt,It.toJSON=Ne,It.toArray=Y,j&&(It.toBuffer=Q),O&&(It.toArrayBuffer=te),yt[Lt]=tt,z[pe]=yt,yt;function yt(et,Qe,rt,it){return this instanceof yt?zt(this,et,Qe,rt,it):new yt(et,Qe,rt,it)}function tt(et){return!!(et&&et[Nt])}function zt(et,Qe,rt,it,vt){if(O&&I&&(Qe instanceof I&&(Qe=new O(Qe)),it instanceof I&&(it=new O(it))),!Qe&&!rt&&!it&&!J){et.buffer=oe(o,0);return}if(!ie(Qe,rt)){var Rt=J||Array;vt=rt,it=Qe,rt=0,Qe=J===j?j.alloc(8):new Rt(8)}et.buffer=Qe,et.offset=rt|=0,D!==typeof it&&(typeof it=="string"?Ot(Qe,rt,it,vt||10):ie(it,vt)?ne(Qe,rt,it,vt):typeof vt=="number"?(Ht(Qe,rt+me,it),Ht(Qe,rt+_e,vt)):it>0?gt(Qe,rt,it):it<0?St(Qe,rt,it):ne(Qe,rt,o,0))}function Ot(et,Qe,rt,it){var vt=0,Rt=rt.length,Mt=0,qt=0;rt[0]==="-"&&vt++;for(var Jt=vt;vt<Rt;){var Wt=parseInt(rt[vt++],it);if(!(Wt>=0))break;qt=qt*it+Wt,Mt=Mt*it+Math.floor(qt/N),qt%=N}Jt&&(Mt=~Mt,qt?qt=N-qt:Mt++),Ht(et,Qe+me,Mt),Ht(et,Qe+_e,qt)}function Ne(){var et=this.buffer,Qe=this.offset,rt=At(et,Qe+me),it=At(et,Qe+_e);return Te||(rt|=0),rt?rt*N+it:it}function nt(et){var Qe=this.buffer,rt=this.offset,it=At(Qe,rt+me),vt=At(Qe,rt+_e),Rt="",Mt=!Te&&it&2147483648;for(Mt&&(it=~it,vt=N-vt),et=et||10;;){var qt=it%et*N+vt;if(it=Math.floor(it/et),vt=Math.floor(qt/et),Rt=(qt%et).toString(et)+Rt,!it&&!vt)break}return Mt&&(Rt="-"+Rt),Rt}function Ht(et,Qe,rt){et[Qe+qe]=rt&255,rt=rt>>8,et[Qe+Fe]=rt&255,rt=rt>>8,et[Qe+je]=rt&255,rt=rt>>8,et[Qe+De]=rt&255}function At(et,Qe){return et[Qe+De]*F+(et[Qe+je]<<16)+(et[Qe+Fe]<<8)+et[Qe+qe]}}function Y(pe){var ve=this.buffer,Te=this.offset;return J=null,pe!==!1&&k(ve)?ve.length===8?ve:ve.slice(Te,Te+8):oe(ve,Te)}function Q(pe){var ve=this.buffer,Te=this.offset;return J=j,pe!==!1&&j.isBuffer(ve)?ve.length===8?ve:ve.slice(Te,Te+8):j.from(te.call(this,pe))}function te(pe){var ve=this.buffer,Te=this.offset,me=ve.buffer;if(J=O,pe!==!1&&!ve.offset&&me instanceof I)return me.byteLength===8?me:me.slice(Te,Te+8);var _e=new O(8);return ne(_e,0,ve,Te),_e.buffer}function ie(pe,ve){var Te=pe&&pe.length;return ve|=0,Te&&ve+8<=Te&&typeof pe[ve]!="string"}function ne(pe,ve,Te,me){ve|=0,me|=0;for(var _e=0;_e<8;_e++)pe[ve++]=Te[me++]&255}function oe(pe,ve){return Array.prototype.slice.call(pe,ve,ve+8)}function ce(pe,ve,Te){for(var me=ve+8;me>ve;)pe[--me]=Te&255,Te/=256}function we(pe,ve,Te){var me=ve+8;for(Te++;me>ve;)pe[--me]=-Te&255^255,Te/=256}function se(pe,ve,Te){for(var me=ve+8;ve<me;)pe[ve++]=Te&255,Te/=256}function ye(pe,ve,Te){var me=ve+8;for(Te++;ve<me;)pe[ve++]=-Te&255^255,Te/=256}function fe(pe){return!!pe&&Object.prototype.toString.call(pe)=="[object Array]"}})(typeof $.nodeName!="string"?$: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)
|
|
8
|
+
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 $=requireTools(),z=requireTools(),D=requireEbmlID(),j=function(){function O(){this._schema=D.byEbmlID,this._buffers=[],this._stack=[]}return O.prototype.encode=function(I){var o=this;return $.concat(I.reduce(function(k,N){return k.concat(o.encodeChunk(N))},[])).buffer},O.prototype.encodeChunk=function(I){return I.type==="m"?I.isEnd?this.endTag(I):this.startTag(I):(I.data=z.Buffer.from(I.data),this.writeTag(I)),this.flush()},O.prototype.flush=function(){var I=this._buffers;return this._buffers=[],I},O.prototype.getSchemaInfo=function(I){for(var o=Object.keys(this._schema).map(Number),k=0;k<o.length;k++){var N=o[k];if(this._schema[N].name===I)return new z.Buffer(N.toString(16),"hex")}return null},O.prototype.writeTag=function(I){var o=I.name,k=this.getSchemaInfo(o),N=I.data;if(k==null)throw new Error("No schema entry found for "+o);var F=$.encodeTag(k,N);if(this._stack.length>0){var J=this._stack[this._stack.length-1];J.children.push({tagId:k,elm:I,children:[],data:F});return}this._buffers=this._buffers.concat(F)},O.prototype.startTag=function(I){var o=I.name,k=this.getSchemaInfo(o);if(k==null)throw new Error("No schema entry found for "+o);if(I.unknownSize){var N=$.encodeTag(k,new z.Buffer(0),I.unknownSize);this._buffers=this._buffers.concat(N);return}var F={tagId:k,elm:I,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(F),this._stack.push(F)},O.prototype.endTag=function(I){I.name;var o=this._stack.pop();if(o==null)throw new Error("EBML structure is broken");if(o.elm.name!==I.name)throw new Error("EBML structure is broken");var k=o.children.reduce(function(F,J){if(J.data===null)throw new Error("EBML structure is broken");return F.concat(J.data)},[]),N=$.concat(k);o.elm.type==="m"?o.data=$.encodeTag(o.tagId,N,o.elm.unknownSize):o.data=$.encodeTag(o.tagId,N),this._stack.length<1&&(this._buffers=this._buffers.concat(o.data))},O}();return EBMLEncoder.default=j,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=k,base64Js.toByteArray=F,base64Js.fromByteArray=Y;for(var $=[],z=[],D=typeof Uint8Array<"u"?Uint8Array:Array,j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=0,I=j.length;O<I;++O)$[O]=j[O],z[j.charCodeAt(O)]=O;z[45]=62,z[95]=63;function o(Q){var te=Q.length;if(te%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ie=Q.indexOf("=");ie===-1&&(ie=te);var ne=ie===te?0:4-ie%4;return[ie,ne]}function k(Q){var te=o(Q),ie=te[0],ne=te[1];return(ie+ne)*3/4-ne}function N(Q,te,ie){return(te+ie)*3/4-ie}function F(Q){var te,ie=o(Q),ne=ie[0],oe=ie[1],ce=new D(N(Q,ne,oe)),we=0,se=oe>0?ne-4:ne,ye;for(ye=0;ye<se;ye+=4)te=z[Q.charCodeAt(ye)]<<18|z[Q.charCodeAt(ye+1)]<<12|z[Q.charCodeAt(ye+2)]<<6|z[Q.charCodeAt(ye+3)],ce[we++]=te>>16&255,ce[we++]=te>>8&255,ce[we++]=te&255;return oe===2&&(te=z[Q.charCodeAt(ye)]<<2|z[Q.charCodeAt(ye+1)]>>4,ce[we++]=te&255),oe===1&&(te=z[Q.charCodeAt(ye)]<<10|z[Q.charCodeAt(ye+1)]<<4|z[Q.charCodeAt(ye+2)]>>2,ce[we++]=te>>8&255,ce[we++]=te&255),ce}function J(Q){return $[Q>>18&63]+$[Q>>12&63]+$[Q>>6&63]+$[Q&63]}function X(Q,te,ie){for(var ne,oe=[],ce=te;ce<ie;ce+=3)ne=(Q[ce]<<16&16711680)+(Q[ce+1]<<8&65280)+(Q[ce+2]&255),oe.push(J(ne));return oe.join("")}function Y(Q){for(var te,ie=Q.length,ne=ie%3,oe=[],ce=16383,we=0,se=ie-ne;we<se;we+=ce)oe.push(X(Q,we,we+ce>se?se:we+ce));return ne===1?(te=Q[ie-1],oe.push($[te>>2]+$[te<<4&63]+"==")):ne===2&&(te=(Q[ie-2]<<8)+Q[ie-1],oe.push($[te>>10]+$[te>>4&63]+$[te<<2&63]+"=")),oe.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($,z,D,j,O){var I,o,k=O*8-j-1,N=(1<<k)-1,F=N>>1,J=-7,X=D?O-1:0,Y=D?-1:1,Q=$[z+X];for(X+=Y,I=Q&(1<<-J)-1,Q>>=-J,J+=k;J>0;I=I*256+$[z+X],X+=Y,J-=8);for(o=I&(1<<-J)-1,I>>=-J,J+=j;J>0;o=o*256+$[z+X],X+=Y,J-=8);if(I===0)I=1-F;else{if(I===N)return o?NaN:(Q?-1:1)*(1/0);o=o+Math.pow(2,j),I=I-F}return(Q?-1:1)*o*Math.pow(2,I-j)},ieee754.write=function($,z,D,j,O,I){var o,k,N,F=I*8-O-1,J=(1<<F)-1,X=J>>1,Y=O===23?Math.pow(2,-24)-Math.pow(2,-77):0,Q=j?0:I-1,te=j?1:-1,ie=z<0||z===0&&1/z<0?1:0;for(z=Math.abs(z),isNaN(z)||z===1/0?(k=isNaN(z)?1:0,o=J):(o=Math.floor(Math.log(z)/Math.LN2),z*(N=Math.pow(2,-o))<1&&(o--,N*=2),o+X>=1?z+=Y/N:z+=Y*Math.pow(2,1-X),z*N>=2&&(o++,N/=2),o+X>=J?(k=0,o=J):o+X>=1?(k=(z*N-1)*Math.pow(2,O),o=o+X):(k=z*Math.pow(2,X-1)*Math.pow(2,O),o=0));O>=8;$[D+Q]=k&255,Q+=te,k/=256,O-=8);for(o=o<<O|k,F+=O;F>0;$[D+Q]=o&255,Q+=te,o/=256,F-=8);$[D+Q-te]|=ie*128}),ieee754}/*!
|
|
9
9
|
* The buffer module from node.js, for the browser.
|
|
10
10
|
*
|
|
11
11
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
12
|
* @license MIT
|
|
13
|
-
*/var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(N){const Z=requireBase64Js(),q=requireIeee754(),J=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;N.Buffer=O,N.SlowBuffer=fe,N.INSPECT_MAX_BYTES=50;const I=2147483647;N.kMaxLength=I,O.TYPED_ARRAY_SUPPORT=D(),!O.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 D(){try{const ae=new Uint8Array(1),Q={foo:function(){return 42}};return Object.setPrototypeOf(Q,Uint8Array.prototype),Object.setPrototypeOf(ae,Q),ae.foo()===42}catch{return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}}),Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function a(ae){if(ae>I)throw new RangeError('The value "'+ae+'" is invalid for option "size"');const Q=new Uint8Array(ae);return Object.setPrototypeOf(Q,O.prototype),Q}function O(ae,Q,X){if(typeof ae=="number"){if(typeof Q=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return te(ae)}return F(ae,Q,X)}O.poolSize=8192;function F(ae,Q,X){if(typeof ae=="string")return ne(ae,Q);if(ArrayBuffer.isView(ae))return re(ae);if(ae==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae);if(Wt(ae,ArrayBuffer)||ae&&Wt(ae.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Wt(ae,SharedArrayBuffer)||ae&&Wt(ae.buffer,SharedArrayBuffer)))return ce(ae,Q,X);if(typeof ae=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const he=ae.valueOf&&ae.valueOf();if(he!=null&&he!==ae)return O.from(he,Q,X);const Te=oe(ae);if(Te)return Te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ae[Symbol.toPrimitive]=="function")return O.from(ae[Symbol.toPrimitive]("string"),Q,X);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ae)}O.from=function(ae,Q,X){return F(ae,Q,X)},Object.setPrototypeOf(O.prototype,Uint8Array.prototype),Object.setPrototypeOf(O,Uint8Array);function z(ae){if(typeof ae!="number")throw new TypeError('"size" argument must be of type number');if(ae<0)throw new RangeError('The value "'+ae+'" is invalid for option "size"')}function K(ae,Q,X){return z(ae),ae<=0?a(ae):Q!==void 0?typeof X=="string"?a(ae).fill(Q,X):a(ae).fill(Q):a(ae)}O.alloc=function(ae,Q,X){return K(ae,Q,X)};function te(ae){return z(ae),a(ae<0?0:se(ae)|0)}O.allocUnsafe=function(ae){return te(ae)},O.allocUnsafeSlow=function(ae){return te(ae)};function ne(ae,Q){if((typeof Q!="string"||Q==="")&&(Q="utf8"),!O.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);const X=ge(ae,Q)|0;let he=a(X);const Te=he.write(ae,Q);return Te!==X&&(he=he.slice(0,Te)),he}function ee(ae){const Q=ae.length<0?0:se(ae.length)|0,X=a(Q);for(let he=0;he<Q;he+=1)X[he]=ae[he]&255;return X}function re(ae){if(Wt(ae,Uint8Array)){const Q=new Uint8Array(ae);return ce(Q.buffer,Q.byteOffset,Q.byteLength)}return ee(ae)}function ce(ae,Q,X){if(Q<0||ae.byteLength<Q)throw new RangeError('"offset" is outside of buffer bounds');if(ae.byteLength<Q+(X||0))throw new RangeError('"length" is outside of buffer bounds');let he;return Q===void 0&&X===void 0?he=new Uint8Array(ae):X===void 0?he=new Uint8Array(ae,Q):he=new Uint8Array(ae,Q,X),Object.setPrototypeOf(he,O.prototype),he}function oe(ae){if(O.isBuffer(ae)){const Q=se(ae.length)|0,X=a(Q);return X.length===0||ae.copy(X,0,0,Q),X}if(ae.length!==void 0)return typeof ae.length!="number"||Gt(ae.length)?a(0):ee(ae);if(ae.type==="Buffer"&&Array.isArray(ae.data))return ee(ae.data)}function se(ae){if(ae>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return ae|0}function fe(ae){return+ae!=ae&&(ae=0),O.alloc(+ae)}O.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==O.prototype},O.compare=function(Q,X){if(Wt(Q,Uint8Array)&&(Q=O.from(Q,Q.offset,Q.byteLength)),Wt(X,Uint8Array)&&(X=O.from(X,X.offset,X.byteLength)),!O.isBuffer(Q)||!O.isBuffer(X))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===X)return 0;let he=Q.length,Te=X.length;for(let $e=0,Ue=Math.min(he,Te);$e<Ue;++$e)if(Q[$e]!==X[$e]){he=Q[$e],Te=X[$e];break}return he<Te?-1:Te<he?1:0},O.isEncoding=function(Q){switch(String(Q).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}},O.concat=function(Q,X){if(!Array.isArray(Q))throw new TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return O.alloc(0);let he;if(X===void 0)for(X=0,he=0;he<Q.length;++he)X+=Q[he].length;const Te=O.allocUnsafe(X);let $e=0;for(he=0;he<Q.length;++he){let Ue=Q[he];if(Wt(Ue,Uint8Array))$e+Ue.length>Te.length?(O.isBuffer(Ue)||(Ue=O.from(Ue)),Ue.copy(Te,$e)):Uint8Array.prototype.set.call(Te,Ue,$e);else if(O.isBuffer(Ue))Ue.copy(Te,$e);else throw new TypeError('"list" argument must be an Array of Buffers');$e+=Ue.length}return Te};function ge(ae,Q){if(O.isBuffer(ae))return ae.length;if(ArrayBuffer.isView(ae)||Wt(ae,ArrayBuffer))return ae.byteLength;if(typeof ae!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ae);const X=ae.length,he=arguments.length>2&&arguments[2]===!0;if(!he&&X===0)return 0;let Te=!1;for(;;)switch(Q){case"ascii":case"latin1":case"binary":return X;case"utf8":case"utf-8":return Zt(ae).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X*2;case"hex":return X>>>1;case"base64":return tn(ae).length;default:if(Te)return he?-1:Zt(ae).length;Q=(""+Q).toLowerCase(),Te=!0}}O.byteLength=ge;function ue(ae,Q,X){let he=!1;if((Q===void 0||Q<0)&&(Q=0),Q>this.length||((X===void 0||X>this.length)&&(X=this.length),X<=0)||(X>>>=0,Q>>>=0,X<=Q))return"";for(ae||(ae="utf8");;)switch(ae){case"hex":return jt(this,Q,X);case"utf8":case"utf-8":return Je(this,Q,X);case"ascii":return Et(this,Q,X);case"latin1":case"binary":return At(this,Q,X);case"base64":return We(this,Q,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,Q,X);default:if(he)throw new TypeError("Unknown encoding: "+ae);ae=(ae+"").toLowerCase(),he=!0}}O.prototype._isBuffer=!0;function _e(ae,Q,X){const he=ae[Q];ae[Q]=ae[X],ae[X]=he}O.prototype.swap16=function(){const Q=this.length;if(Q%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let X=0;X<Q;X+=2)_e(this,X,X+1);return this},O.prototype.swap32=function(){const Q=this.length;if(Q%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let X=0;X<Q;X+=4)_e(this,X,X+3),_e(this,X+1,X+2);return this},O.prototype.swap64=function(){const Q=this.length;if(Q%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let X=0;X<Q;X+=8)_e(this,X,X+7),_e(this,X+1,X+6),_e(this,X+2,X+5),_e(this,X+3,X+4);return this},O.prototype.toString=function(){const Q=this.length;return Q===0?"":arguments.length===0?Je(this,0,Q):ue.apply(this,arguments)},O.prototype.toLocaleString=O.prototype.toString,O.prototype.equals=function(Q){if(!O.isBuffer(Q))throw new TypeError("Argument must be a Buffer");return this===Q?!0:O.compare(this,Q)===0},O.prototype.inspect=function(){let Q="";const X=N.INSPECT_MAX_BYTES;return Q=this.toString("hex",0,X).replace(/(.{2})/g,"$1 ").trim(),this.length>X&&(Q+=" ... "),"<Buffer "+Q+">"},J&&(O.prototype[J]=O.prototype.inspect),O.prototype.compare=function(Q,X,he,Te,$e){if(Wt(Q,Uint8Array)&&(Q=O.from(Q,Q.offset,Q.byteLength)),!O.isBuffer(Q))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if(X===void 0&&(X=0),he===void 0&&(he=Q?Q.length:0),Te===void 0&&(Te=0),$e===void 0&&($e=this.length),X<0||he>Q.length||Te<0||$e>this.length)throw new RangeError("out of range index");if(Te>=$e&&X>=he)return 0;if(Te>=$e)return-1;if(X>=he)return 1;if(X>>>=0,he>>>=0,Te>>>=0,$e>>>=0,this===Q)return 0;let Ue=$e-Te,ct=he-X;const kt=Math.min(Ue,ct),yt=this.slice(Te,$e),It=Q.slice(X,he);for(let St=0;St<kt;++St)if(yt[St]!==It[St]){Ue=yt[St],ct=It[St];break}return Ue<ct?-1:ct<Ue?1:0};function pe(ae,Q,X,he,Te){if(ae.length===0)return-1;if(typeof X=="string"?(he=X,X=0):X>2147483647?X=2147483647:X<-2147483648&&(X=-2147483648),X=+X,Gt(X)&&(X=Te?0:ae.length-1),X<0&&(X=ae.length+X),X>=ae.length){if(Te)return-1;X=ae.length-1}else if(X<0)if(Te)X=0;else return-1;if(typeof Q=="string"&&(Q=O.from(Q,he)),O.isBuffer(Q))return Q.length===0?-1:ye(ae,Q,X,he,Te);if(typeof Q=="number")return Q=Q&255,typeof Uint8Array.prototype.indexOf=="function"?Te?Uint8Array.prototype.indexOf.call(ae,Q,X):Uint8Array.prototype.lastIndexOf.call(ae,Q,X):ye(ae,[Q],X,he,Te);throw new TypeError("val must be string, number or Buffer")}function ye(ae,Q,X,he,Te){let $e=1,Ue=ae.length,ct=Q.length;if(he!==void 0&&(he=String(he).toLowerCase(),he==="ucs2"||he==="ucs-2"||he==="utf16le"||he==="utf-16le")){if(ae.length<2||Q.length<2)return-1;$e=2,Ue/=2,ct/=2,X/=2}function kt(It,St){return $e===1?It[St]:It.readUInt16BE(St*$e)}let yt;if(Te){let It=-1;for(yt=X;yt<Ue;yt++)if(kt(ae,yt)===kt(Q,It===-1?0:yt-It)){if(It===-1&&(It=yt),yt-It+1===ct)return It*$e}else It!==-1&&(yt-=yt-It),It=-1}else for(X+ct>Ue&&(X=Ue-ct),yt=X;yt>=0;yt--){let It=!0;for(let St=0;St<ct;St++)if(kt(ae,yt+St)!==kt(Q,St)){It=!1;break}if(It)return yt}return-1}O.prototype.includes=function(Q,X,he){return this.indexOf(Q,X,he)!==-1},O.prototype.indexOf=function(Q,X,he){return pe(this,Q,X,he,!0)},O.prototype.lastIndexOf=function(Q,X,he){return pe(this,Q,X,he,!1)};function we(ae,Q,X,he){X=Number(X)||0;const Te=ae.length-X;he?(he=Number(he),he>Te&&(he=Te)):he=Te;const $e=Q.length;he>$e/2&&(he=$e/2);let Ue;for(Ue=0;Ue<he;++Ue){const ct=parseInt(Q.substr(Ue*2,2),16);if(Gt(ct))return Ue;ae[X+Ue]=ct}return Ue}function Ie(ae,Q,X,he){return nn(Zt(Q,ae.length-X),ae,X,he)}function be(ae,Q,X,he){return nn(Kt(Q),ae,X,he)}function Se(ae,Q,X,he){return nn(tn(Q),ae,X,he)}function Me(ae,Q,X,he){return nn(fn(Q,ae.length-X),ae,X,he)}O.prototype.write=function(Q,X,he,Te){if(X===void 0)Te="utf8",he=this.length,X=0;else if(he===void 0&&typeof X=="string")Te=X,he=this.length,X=0;else if(isFinite(X))X=X>>>0,isFinite(he)?(he=he>>>0,Te===void 0&&(Te="utf8")):(Te=he,he=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $e=this.length-X;if((he===void 0||he>$e)&&(he=$e),Q.length>0&&(he<0||X<0)||X>this.length)throw new RangeError("Attempt to write outside buffer bounds");Te||(Te="utf8");let Ue=!1;for(;;)switch(Te){case"hex":return we(this,Q,X,he);case"utf8":case"utf-8":return Ie(this,Q,X,he);case"ascii":case"latin1":case"binary":return be(this,Q,X,he);case"base64":return Se(this,Q,X,he);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,Q,X,he);default:if(Ue)throw new TypeError("Unknown encoding: "+Te);Te=(""+Te).toLowerCase(),Ue=!0}},O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function We(ae,Q,X){return Q===0&&X===ae.length?Z.fromByteArray(ae):Z.fromByteArray(ae.slice(Q,X))}function Je(ae,Q,X){X=Math.min(ae.length,X);const he=[];let Te=Q;for(;Te<X;){const $e=ae[Te];let Ue=null,ct=$e>239?4:$e>223?3:$e>191?2:1;if(Te+ct<=X){let kt,yt,It,St;switch(ct){case 1:$e<128&&(Ue=$e);break;case 2:kt=ae[Te+1],(kt&192)===128&&(St=($e&31)<<6|kt&63,St>127&&(Ue=St));break;case 3:kt=ae[Te+1],yt=ae[Te+2],(kt&192)===128&&(yt&192)===128&&(St=($e&15)<<12|(kt&63)<<6|yt&63,St>2047&&(St<55296||St>57343)&&(Ue=St));break;case 4:kt=ae[Te+1],yt=ae[Te+2],It=ae[Te+3],(kt&192)===128&&(yt&192)===128&&(It&192)===128&&(St=($e&15)<<18|(kt&63)<<12|(yt&63)<<6|It&63,St>65535&&St<1114112&&(Ue=St))}}Ue===null?(Ue=65533,ct=1):Ue>65535&&(Ue-=65536,he.push(Ue>>>10&1023|55296),Ue=56320|Ue&1023),he.push(Ue),Te+=ct}return Tt(he)}const Le=4096;function Tt(ae){const Q=ae.length;if(Q<=Le)return String.fromCharCode.apply(String,ae);let X="",he=0;for(;he<Q;)X+=String.fromCharCode.apply(String,ae.slice(he,he+=Le));return X}function Et(ae,Q,X){let he="";X=Math.min(ae.length,X);for(let Te=Q;Te<X;++Te)he+=String.fromCharCode(ae[Te]&127);return he}function At(ae,Q,X){let he="";X=Math.min(ae.length,X);for(let Te=Q;Te<X;++Te)he+=String.fromCharCode(ae[Te]);return he}function jt(ae,Q,X){const he=ae.length;(!Q||Q<0)&&(Q=0),(!X||X<0||X>he)&&(X=he);let Te="";for(let $e=Q;$e<X;++$e)Te+=_n[ae[$e]];return Te}function Pt(ae,Q,X){const he=ae.slice(Q,X);let Te="";for(let $e=0;$e<he.length-1;$e+=2)Te+=String.fromCharCode(he[$e]+he[$e+1]*256);return Te}O.prototype.slice=function(Q,X){const he=this.length;Q=~~Q,X=X===void 0?he:~~X,Q<0?(Q+=he,Q<0&&(Q=0)):Q>he&&(Q=he),X<0?(X+=he,X<0&&(X=0)):X>he&&(X=he),X<Q&&(X=Q);const Te=this.subarray(Q,X);return Object.setPrototypeOf(Te,O.prototype),Te};function _t(ae,Q,X){if(ae%1!==0||ae<0)throw new RangeError("offset is not uint");if(ae+Q>X)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(Q,X,he){Q=Q>>>0,X=X>>>0,he||_t(Q,X,this.length);let Te=this[Q],$e=1,Ue=0;for(;++Ue<X&&($e*=256);)Te+=this[Q+Ue]*$e;return Te},O.prototype.readUintBE=O.prototype.readUIntBE=function(Q,X,he){Q=Q>>>0,X=X>>>0,he||_t(Q,X,this.length);let Te=this[Q+--X],$e=1;for(;X>0&&($e*=256);)Te+=this[Q+--X]*$e;return Te},O.prototype.readUint8=O.prototype.readUInt8=function(Q,X){return Q=Q>>>0,X||_t(Q,1,this.length),this[Q]},O.prototype.readUint16LE=O.prototype.readUInt16LE=function(Q,X){return Q=Q>>>0,X||_t(Q,2,this.length),this[Q]|this[Q+1]<<8},O.prototype.readUint16BE=O.prototype.readUInt16BE=function(Q,X){return Q=Q>>>0,X||_t(Q,2,this.length),this[Q]<<8|this[Q+1]},O.prototype.readUint32LE=O.prototype.readUInt32LE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216},O.prototype.readUint32BE=O.prototype.readUInt32BE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])},O.prototype.readBigUInt64LE=rn(function(Q){Q=Q>>>0,gt(Q,"offset");const X=this[Q],he=this[Q+7];(X===void 0||he===void 0)&&Dt(Q,this.length-8);const Te=X+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24,$e=this[++Q]+this[++Q]*2**8+this[++Q]*2**16+he*2**24;return BigInt(Te)+(BigInt($e)<<BigInt(32))}),O.prototype.readBigUInt64BE=rn(function(Q){Q=Q>>>0,gt(Q,"offset");const X=this[Q],he=this[Q+7];(X===void 0||he===void 0)&&Dt(Q,this.length-8);const Te=X*2**24+this[++Q]*2**16+this[++Q]*2**8+this[++Q],$e=this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+he;return(BigInt(Te)<<BigInt(32))+BigInt($e)}),O.prototype.readIntLE=function(Q,X,he){Q=Q>>>0,X=X>>>0,he||_t(Q,X,this.length);let Te=this[Q],$e=1,Ue=0;for(;++Ue<X&&($e*=256);)Te+=this[Q+Ue]*$e;return $e*=128,Te>=$e&&(Te-=Math.pow(2,8*X)),Te},O.prototype.readIntBE=function(Q,X,he){Q=Q>>>0,X=X>>>0,he||_t(Q,X,this.length);let Te=X,$e=1,Ue=this[Q+--Te];for(;Te>0&&($e*=256);)Ue+=this[Q+--Te]*$e;return $e*=128,Ue>=$e&&(Ue-=Math.pow(2,8*X)),Ue},O.prototype.readInt8=function(Q,X){return Q=Q>>>0,X||_t(Q,1,this.length),this[Q]&128?(255-this[Q]+1)*-1:this[Q]},O.prototype.readInt16LE=function(Q,X){Q=Q>>>0,X||_t(Q,2,this.length);const he=this[Q]|this[Q+1]<<8;return he&32768?he|4294901760:he},O.prototype.readInt16BE=function(Q,X){Q=Q>>>0,X||_t(Q,2,this.length);const he=this[Q+1]|this[Q]<<8;return he&32768?he|4294901760:he},O.prototype.readInt32LE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24},O.prototype.readInt32BE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]},O.prototype.readBigInt64LE=rn(function(Q){Q=Q>>>0,gt(Q,"offset");const X=this[Q],he=this[Q+7];(X===void 0||he===void 0)&&Dt(Q,this.length-8);const Te=this[Q+4]+this[Q+5]*2**8+this[Q+6]*2**16+(he<<24);return(BigInt(Te)<<BigInt(32))+BigInt(X+this[++Q]*2**8+this[++Q]*2**16+this[++Q]*2**24)}),O.prototype.readBigInt64BE=rn(function(Q){Q=Q>>>0,gt(Q,"offset");const X=this[Q],he=this[Q+7];(X===void 0||he===void 0)&&Dt(Q,this.length-8);const Te=(X<<24)+this[++Q]*2**16+this[++Q]*2**8+this[++Q];return(BigInt(Te)<<BigInt(32))+BigInt(this[++Q]*2**24+this[++Q]*2**16+this[++Q]*2**8+he)}),O.prototype.readFloatLE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),q.read(this,Q,!0,23,4)},O.prototype.readFloatBE=function(Q,X){return Q=Q>>>0,X||_t(Q,4,this.length),q.read(this,Q,!1,23,4)},O.prototype.readDoubleLE=function(Q,X){return Q=Q>>>0,X||_t(Q,8,this.length),q.read(this,Q,!0,52,8)},O.prototype.readDoubleBE=function(Q,X){return Q=Q>>>0,X||_t(Q,8,this.length),q.read(this,Q,!1,52,8)};function rt(ae,Q,X,he,Te,$e){if(!O.isBuffer(ae))throw new TypeError('"buffer" argument must be a Buffer instance');if(Q>Te||Q<$e)throw new RangeError('"value" argument is out of bounds');if(X+he>ae.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(Q,X,he,Te){if(Q=+Q,X=X>>>0,he=he>>>0,!Te){const ct=Math.pow(2,8*he)-1;rt(this,Q,X,he,ct,0)}let $e=1,Ue=0;for(this[X]=Q&255;++Ue<he&&($e*=256);)this[X+Ue]=Q/$e&255;return X+he},O.prototype.writeUintBE=O.prototype.writeUIntBE=function(Q,X,he,Te){if(Q=+Q,X=X>>>0,he=he>>>0,!Te){const ct=Math.pow(2,8*he)-1;rt(this,Q,X,he,ct,0)}let $e=he-1,Ue=1;for(this[X+$e]=Q&255;--$e>=0&&(Ue*=256);)this[X+$e]=Q/Ue&255;return X+he},O.prototype.writeUint8=O.prototype.writeUInt8=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,1,255,0),this[X]=Q&255,X+1},O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,2,65535,0),this[X]=Q&255,this[X+1]=Q>>>8,X+2},O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,2,65535,0),this[X]=Q>>>8,this[X+1]=Q&255,X+2},O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,4,4294967295,0),this[X+3]=Q>>>24,this[X+2]=Q>>>16,this[X+1]=Q>>>8,this[X]=Q&255,X+4},O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,4,4294967295,0),this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255,X+4};function Vt(ae,Q,X,he,Te){st(Q,he,Te,ae,X,7);let $e=Number(Q&BigInt(4294967295));ae[X++]=$e,$e=$e>>8,ae[X++]=$e,$e=$e>>8,ae[X++]=$e,$e=$e>>8,ae[X++]=$e;let Ue=Number(Q>>BigInt(32)&BigInt(4294967295));return ae[X++]=Ue,Ue=Ue>>8,ae[X++]=Ue,Ue=Ue>>8,ae[X++]=Ue,Ue=Ue>>8,ae[X++]=Ue,X}function Rt(ae,Q,X,he,Te){st(Q,he,Te,ae,X,7);let $e=Number(Q&BigInt(4294967295));ae[X+7]=$e,$e=$e>>8,ae[X+6]=$e,$e=$e>>8,ae[X+5]=$e,$e=$e>>8,ae[X+4]=$e;let Ue=Number(Q>>BigInt(32)&BigInt(4294967295));return ae[X+3]=Ue,Ue=Ue>>8,ae[X+2]=Ue,Ue=Ue>>8,ae[X+1]=Ue,Ue=Ue>>8,ae[X]=Ue,X+8}O.prototype.writeBigUInt64LE=rn(function(Q,X=0){return Vt(this,Q,X,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeBigUInt64BE=rn(function(Q,X=0){return Rt(this,Q,X,BigInt(0),BigInt("0xffffffffffffffff"))}),O.prototype.writeIntLE=function(Q,X,he,Te){if(Q=+Q,X=X>>>0,!Te){const kt=Math.pow(2,8*he-1);rt(this,Q,X,he,kt-1,-kt)}let $e=0,Ue=1,ct=0;for(this[X]=Q&255;++$e<he&&(Ue*=256);)Q<0&&ct===0&&this[X+$e-1]!==0&&(ct=1),this[X+$e]=(Q/Ue>>0)-ct&255;return X+he},O.prototype.writeIntBE=function(Q,X,he,Te){if(Q=+Q,X=X>>>0,!Te){const kt=Math.pow(2,8*he-1);rt(this,Q,X,he,kt-1,-kt)}let $e=he-1,Ue=1,ct=0;for(this[X+$e]=Q&255;--$e>=0&&(Ue*=256);)Q<0&&ct===0&&this[X+$e+1]!==0&&(ct=1),this[X+$e]=(Q/Ue>>0)-ct&255;return X+he},O.prototype.writeInt8=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,1,127,-128),Q<0&&(Q=255+Q+1),this[X]=Q&255,X+1},O.prototype.writeInt16LE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,2,32767,-32768),this[X]=Q&255,this[X+1]=Q>>>8,X+2},O.prototype.writeInt16BE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,2,32767,-32768),this[X]=Q>>>8,this[X+1]=Q&255,X+2},O.prototype.writeInt32LE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,4,2147483647,-2147483648),this[X]=Q&255,this[X+1]=Q>>>8,this[X+2]=Q>>>16,this[X+3]=Q>>>24,X+4},O.prototype.writeInt32BE=function(Q,X,he){return Q=+Q,X=X>>>0,he||rt(this,Q,X,4,2147483647,-2147483648),Q<0&&(Q=4294967295+Q+1),this[X]=Q>>>24,this[X+1]=Q>>>16,this[X+2]=Q>>>8,this[X+3]=Q&255,X+4},O.prototype.writeBigInt64LE=rn(function(Q,X=0){return Vt(this,Q,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),O.prototype.writeBigInt64BE=rn(function(Q,X=0){return Rt(this,Q,X,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Pe(ae,Q,X,he,Te,$e){if(X+he>ae.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("Index out of range")}function it(ae,Q,X,he,Te){return Q=+Q,X=X>>>0,Te||Pe(ae,Q,X,4),q.write(ae,Q,X,he,23,4),X+4}O.prototype.writeFloatLE=function(Q,X,he){return it(this,Q,X,!0,he)},O.prototype.writeFloatBE=function(Q,X,he){return it(this,Q,X,!1,he)};function zt(ae,Q,X,he,Te){return Q=+Q,X=X>>>0,Te||Pe(ae,Q,X,8),q.write(ae,Q,X,he,52,8),X+8}O.prototype.writeDoubleLE=function(Q,X,he){return zt(this,Q,X,!0,he)},O.prototype.writeDoubleBE=function(Q,X,he){return zt(this,Q,X,!1,he)},O.prototype.copy=function(Q,X,he,Te){if(!O.isBuffer(Q))throw new TypeError("argument should be a Buffer");if(he||(he=0),!Te&&Te!==0&&(Te=this.length),X>=Q.length&&(X=Q.length),X||(X=0),Te>0&&Te<he&&(Te=he),Te===he||Q.length===0||this.length===0)return 0;if(X<0)throw new RangeError("targetStart out of bounds");if(he<0||he>=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),Q.length-X<Te-he&&(Te=Q.length-X+he);const $e=Te-he;return this===Q&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(X,he,Te):Uint8Array.prototype.set.call(Q,this.subarray(he,Te),X),$e},O.prototype.fill=function(Q,X,he,Te){if(typeof Q=="string"){if(typeof X=="string"?(Te=X,X=0,he=this.length):typeof he=="string"&&(Te=he,he=this.length),Te!==void 0&&typeof Te!="string")throw new TypeError("encoding must be a string");if(typeof Te=="string"&&!O.isEncoding(Te))throw new TypeError("Unknown encoding: "+Te);if(Q.length===1){const Ue=Q.charCodeAt(0);(Te==="utf8"&&Ue<128||Te==="latin1")&&(Q=Ue)}}else typeof Q=="number"?Q=Q&255:typeof Q=="boolean"&&(Q=Number(Q));if(X<0||this.length<X||this.length<he)throw new RangeError("Out of range index");if(he<=X)return this;X=X>>>0,he=he===void 0?this.length:he>>>0,Q||(Q=0);let $e;if(typeof Q=="number")for($e=X;$e<he;++$e)this[$e]=Q;else{const Ue=O.isBuffer(Q)?Q:O.from(Q,Te),ct=Ue.length;if(ct===0)throw new TypeError('The value "'+Q+'" is invalid for argument "value"');for($e=0;$e<he-X;++$e)this[$e+X]=Ue[$e%ct]}return this};const Bt={};function nt(ae,Q,X){Bt[ae]=class extends X{constructor(){super(),Object.defineProperty(this,"message",{value:Q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ae}]`,this.stack,delete this.name}get code(){return ae}set code(Te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Te,writable:!0})}toString(){return`${this.name} [${ae}]: ${this.message}`}}}nt("ERR_BUFFER_OUT_OF_BOUNDS",function(ae){return ae?`${ae} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),nt("ERR_INVALID_ARG_TYPE",function(ae,Q){return`The "${ae}" argument must be of type number. Received type ${typeof Q}`},TypeError),nt("ERR_OUT_OF_RANGE",function(ae,Q,X){let he=`The value of "${ae}" is out of range.`,Te=X;return Number.isInteger(X)&&Math.abs(X)>2**32?Te=et(String(X)):typeof X=="bigint"&&(Te=String(X),(X>BigInt(2)**BigInt(32)||X<-(BigInt(2)**BigInt(32)))&&(Te=et(Te)),Te+="n"),he+=` It must be ${Q}. Received ${Te}`,he},RangeError);function et(ae){let Q="",X=ae.length;const he=ae[0]==="-"?1:0;for(;X>=he+4;X-=3)Q=`_${ae.slice(X-3,X)}${Q}`;return`${ae.slice(0,X)}${Q}`}function ot(ae,Q,X){gt(Q,"offset"),(ae[Q]===void 0||ae[Q+X]===void 0)&&Dt(Q,ae.length-(X+1))}function st(ae,Q,X,he,Te,$e){if(ae>X||ae<Q){const Ue=typeof Q=="bigint"?"n":"";let ct;throw Q===0||Q===BigInt(0)?ct=`>= 0${Ue} and < 2${Ue} ** ${($e+1)*8}${Ue}`:ct=`>= -(2${Ue} ** ${($e+1)*8-1}${Ue}) and < 2 ** ${($e+1)*8-1}${Ue}`,new Bt.ERR_OUT_OF_RANGE("value",ct,ae)}ot(he,Te,$e)}function gt(ae,Q){if(typeof ae!="number")throw new Bt.ERR_INVALID_ARG_TYPE(Q,"number",ae)}function Dt(ae,Q,X){throw Math.floor(ae)!==ae?(gt(ae,X),new Bt.ERR_OUT_OF_RANGE("offset","an integer",ae)):Q<0?new Bt.ERR_BUFFER_OUT_OF_BOUNDS:new Bt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Q}`,ae)}const Ut=/[^+/0-9A-Za-z-_]/g;function Lt(ae){if(ae=ae.split("=")[0],ae=ae.trim().replace(Ut,""),ae.length<2)return"";for(;ae.length%4!==0;)ae=ae+"=";return ae}function Zt(ae,Q){Q=Q||1/0;let X;const he=ae.length;let Te=null;const $e=[];for(let Ue=0;Ue<he;++Ue){if(X=ae.charCodeAt(Ue),X>55295&&X<57344){if(!Te){if(X>56319){(Q-=3)>-1&&$e.push(239,191,189);continue}else if(Ue+1===he){(Q-=3)>-1&&$e.push(239,191,189);continue}Te=X;continue}if(X<56320){(Q-=3)>-1&&$e.push(239,191,189),Te=X;continue}X=(Te-55296<<10|X-56320)+65536}else Te&&(Q-=3)>-1&&$e.push(239,191,189);if(Te=null,X<128){if((Q-=1)<0)break;$e.push(X)}else if(X<2048){if((Q-=2)<0)break;$e.push(X>>6|192,X&63|128)}else if(X<65536){if((Q-=3)<0)break;$e.push(X>>12|224,X>>6&63|128,X&63|128)}else if(X<1114112){if((Q-=4)<0)break;$e.push(X>>18|240,X>>12&63|128,X>>6&63|128,X&63|128)}else throw new Error("Invalid code point")}return $e}function Kt(ae){const Q=[];for(let X=0;X<ae.length;++X)Q.push(ae.charCodeAt(X)&255);return Q}function fn(ae,Q){let X,he,Te;const $e=[];for(let Ue=0;Ue<ae.length&&!((Q-=2)<0);++Ue)X=ae.charCodeAt(Ue),he=X>>8,Te=X%256,$e.push(Te),$e.push(he);return $e}function tn(ae){return Z.toByteArray(Lt(ae))}function nn(ae,Q,X,he){let Te;for(Te=0;Te<he&&!(Te+X>=Q.length||Te>=ae.length);++Te)Q[Te+X]=ae[Te];return Te}function Wt(ae,Q){return ae instanceof Q||ae!=null&&ae.constructor!=null&&ae.constructor.name!=null&&ae.constructor.name===Q.name}function Gt(ae){return ae!==ae}const _n=function(){const ae="0123456789abcdef",Q=new Array(256);for(let X=0;X<16;++X){const he=X*16;for(let Te=0;Te<16;++Te)Q[he+Te]=ae[X]+ae[Te]}return Q}();function rn(ae){return typeof BigInt>"u"?Qt:ae}function Qt(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var N=toolsEbml&&toolsEbml.__assign||function(){return N=Object.assign||function(I){for(var D,a=1,O=arguments.length;a<O;a++){D=arguments[a];for(var F in D)Object.prototype.hasOwnProperty.call(D,F)&&(I[F]=D[F])}return I},N.apply(this,arguments)},Z=toolsEbml&&toolsEbml.__spreadArray||function(I,D,a){if(a||arguments.length===2)for(var O=0,F=D.length,z;O<F;O++)(z||!(O in D))&&(z||(z=Array.prototype.slice.call(D,0,O)),z[O]=D[O]);return I.concat(z||Array.prototype.slice.call(D))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var q=requireTools(),J=function(){function I(){}return I.readVint=function(D,a){a===void 0&&(a=0);var O=8-Math.floor(Math.log2(D[a]));if(O>8){var F=I.readHexString(D,a,a+O);throw new Error("Unrepresentable length: ".concat(O," ").concat(F))}if(a+O>D.length)return null;for(var z=D[a]&(1<<8-O)-1,K=1;K<O;K+=1){if(K===7&&z>=Math.pow(2,8)&&D[a+7]>0)return{length:O,value:-1};z*=Math.pow(2,8),z+=D[a+K]}return{length:O,value:z}},I.writeVint=function(D){if(D<0||D>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(D));var a=1;for(a=1;a<=8&&!(D<Math.pow(2,7*a)-1);a+=1);for(var O=q.Buffer.alloc(a),F=D,z=1;z<=a;z+=1){var K=F&255;O[a-z]=K,F-=K,F/=Math.pow(2,8)}return O[0]|=1<<8-a,O},I.concatenate=function(D,a){return!D&&!a?q.Buffer.from([]):!D||D.byteLength===0?a:!a||a.byteLength===0?D:q.Buffer.from(Z(Z([],D,!0),a,!0))},I.readHexString=function(D,a,O){return a===void 0&&(a=0),O===void 0&&(O=D.byteLength),Array.from(D.slice(a,O)).map(function(F){return Number(F).toString(16)}).reduce(function(F,z){return"".concat(F).concat(z.padStart(2,"0"))},"")},I.readUtf8=function(D){try{return q.Buffer.from(D).toString("utf8")}catch{return null}},I.readUnsigned=function(D){var a=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return a.getUint8(0);case 2:return a.getUint16(0);case 4:return a.getUint32(0)}return D.byteLength<=6?D.reduce(function(O,F){return O*256+F},0):I.readHexString(D,0,D.byteLength)},I.readSigned=function(D){var a=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return a.getInt8(0);case 2:return a.getInt16(0);case 4:return a.getInt32(0);default:return NaN}},I.readFloat=function(D){var a=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 4:return a.getFloat32(0);case 8:return a.getFloat64(0);default:return NaN}},I.readDate=function(D){var a=new DataView(D.buffer,D.byteOffset,D.byteLength);switch(D.byteLength){case 1:return new Date(a.getUint8(0));case 2:return new Date(a.getUint16(0));case 4:return new Date(a.getUint32(0));case 8:return new Date(Number.parseInt(I.readHexString(D),16));default:return new Date(0)}},I.readDataFromTag=function(D,a){var O=D.type,F=D.name,z=D.track,K=D.discardable||!1,te=D.keyframe||!1,ne=null,ee;switch(O){case"u":ee=I.readUnsigned(a);break;case"f":ee=I.readFloat(a);break;case"i":ee=I.readSigned(a);break;case"s":ee=String.fromCharCode.apply(String,a);break;case"8":ee=I.readUtf8(a);break;case"d":ee=I.readDate(a);break}if(F==="SimpleBlock"||F==="Block"){var re=0,ce=I.readVint(a,re),oe=ce.length,se=ce.value;re+=oe,z=se,ee=I.readSigned(a.subarray(re,re+2)),re+=2,F==="SimpleBlock"&&(te=!!(a[oe+2]&128),K=!!(a[oe+2]&1)),re+=1,ne=a.subarray(re)}return N(N({},D),{data:a,discardable:K,keyframe:te,payload:ne,track:z,value:ee})},I}();return toolsEbml.default=J,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(N,Z,q){Z=Z||0;for(var J=1;J<=8&&!(N[Z]>=Math.pow(2,8-J));J++);if(J>8)throw new Error("Unrepresentable length: "+J+" "+N.toString("hex",Z,Z+J));if(Z+J>N.length)return null;var I,D=N[Z]&(1<<8-J)-1;for(I=1;I<J;I++){if(I===7&&D>=Math.pow(2,45)&&N[Z+7]>0)return{length:J,value:-1};D*=Math.pow(2,8),D+=N[Z+I]}return q&&(D-=Math.pow(2,J*7-1)-1),{length:J,value:D}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var N=requireVint();function Z(q){this.buffer=q,this.offset=0}return Z.prototype.nextInt16BE=function(){var q=this.buffer.readInt16BE(this.offset);return this.offset+=2,q},Z.prototype.nextUInt8=function(){var q=this.buffer.readUInt8(this.offset);return this.offset+=1,q},Z.prototype.nextUIntV=function(){var q=N(this.buffer,this.offset);return this.offset+=q.length,q.value},Z.prototype.nextIntV=function(){var q=N(this.buffer,this.offset,!0);return this.offset+=q.length,q.value},Z.prototype.nextBuffer=function(q){var J=q?this.buffer.slice(this.offset,this.offset+q):this.buffer.slice(this.offset);return this.offset+=q||this.length,J},Object.defineProperty(Z.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=Z,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var N=requireBufferReader(),Z=1,q=3,J=2;ebmlBlock=function(D){var a={},O=new N(D);a.trackNumber=O.nextUIntV(),a.timecode=O.nextInt16BE();var F=O.nextUInt8();a.invisible=!!(F&8),a.keyframe=!!(F&128),a.discardable=!!(F&1);var z=(F&6)>>1;return a.frames=I(O,z),a};function I(D,a){if(!a)return[D.nextBuffer()];var O,F,z=[],K=D.nextUInt8()+1;if(a===J){if(D.length%K!==0)throw new Error("Fixed-Size Lacing Error");for(F=D.length/K,O=0;O<K;O++)z.push(D.nextBuffer(F));return z}var te=[];if(a===Z)for(O=0;O<K-1;O++){var ne;F=0;do ne=D.nextUInt8(),F+=ne;while(ne===255);te.push(F)}else if(a===q)for(F=D.nextUIntV(),te.push(F),O=1;O<K-1;O++)F+=D.nextIntV(),te.push(F);for(O=0;O<K-1;O++)z.push(D.nextBuffer(te[O]));return z.push(D.nextBuffer()),z}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(N){Object.defineProperty(N,"__esModule",{value:!0}),N.convertEBMLDateToJSDate=N.createFloatBuffer=N.createIntBuffer=N.createUIntBuffer=N.encodeValueToBuffer=N.concat=N.putRefinedMetaData=N.extractElement=N.removeElement=N.makeMetadataSeekable=N.createRIFFChunk=N.VP8BitStreamToRiffWebPBuffer=N.WebPBlockFilter=N.encodeTag=N.readBlock=N.ebmlBlock=N.writeVint=N.readVint=N.Buffer=void 0;var Z=requireInt64Buffer(),q=requireEBMLEncoder(),J=requireBuffer(),I=requireToolsEbml(),D=requireEbmlBlock();N.Buffer=J.Buffer,N.readVint=I.default.readVint,N.writeVint=I.default.writeVint,N.ebmlBlock=D;function a(be){return(0,N.ebmlBlock)(new N.Buffer(be))}N.readBlock=a;function O(be,Se,Me){return Me===void 0&&(Me=!1),ue([be,Me?new N.Buffer("01ffffffffffffff","hex"):(0,N.writeVint)(Se.length),Se])}N.encodeTag=O;function F(be){return be.reduce(function(Se,Me){if(Me.type!=="b"||Me.name!=="SimpleBlock")return Se;var We=(0,N.ebmlBlock)(Me.data),Je=We.frames.some(function(Le){var Tt=Le.slice(3,6).toString("hex");return Tt==="9d012a"});return Je?Se.concat(Me):Se},[])}N.WebPBlockFilter=F;function z(be){var Se=K("VP8 ",be),Me=ue([new N.Buffer("WEBP","ascii"),Se]);return K("RIFF",Me)}N.VP8BitStreamToRiffWebPBuffer=z;function K(be,Se){var Me=new N.Buffer(4);return Me.writeUInt32LE(Se.byteLength,0),ue([new N.Buffer(be.substr(0,4),"ascii"),Me,Se,new N.Buffer(Se.byteLength%2===0?0:1)])}N.createRIFFChunk=K;function te(be,Se,Me){var We=ee("EBML",be),Je=ce(We),Le=Je+12,Tt=be[be.length-1].dataEnd-Le,Et=ee("Info",be);ne("Duration",Et),Et.splice(1,0,{name:"Duration",type:"f",data:we(Se,8)});for(var At=ce(Et),jt=ee("Tracks",be),Pt=ce(jt),_t=47,rt=[],Vt=5+Me.length*15,Rt=[],Pe=-1,it=10,zt=function(st){var gt=_t,Dt=gt+At,Ut=Dt+Pt,Lt=Ut+Vt,Zt=Lt-Tt;if(rt=[],rt.push({name:"SeekHead",type:"m",isEnd:!1}),rt.push({name:"Seek",type:"m",isEnd:!1}),rt.push({name:"SeekID",type:"b",data:new N.Buffer([21,73,169,102])}),rt.push({name:"SeekPosition",type:"u",data:pe(gt)}),rt.push({name:"Seek",type:"m",isEnd:!0}),rt.push({name:"Seek",type:"m",isEnd:!1}),rt.push({name:"SeekID",type:"b",data:new N.Buffer([22,84,174,107])}),rt.push({name:"SeekPosition",type:"u",data:pe(Dt)}),rt.push({name:"Seek",type:"m",isEnd:!0}),rt.push({name:"Seek",type:"m",isEnd:!1}),rt.push({name:"SeekID",type:"b",data:new N.Buffer([28,83,187,107])}),rt.push({name:"SeekPosition",type:"u",data:pe(Ut)}),rt.push({name:"Seek",type:"m",isEnd:!0}),rt.push({name:"SeekHead",type:"m",isEnd:!0}),_t=ce(rt),Rt=[],Rt.push({name:"Cues",type:"m",isEnd:!1}),Me.forEach(function(Kt){var fn=Kt.CueTrack,tn=Kt.CueClusterPosition,nn=Kt.CueTime;Rt.push({name:"CuePoint",type:"m",isEnd:!1}),Rt.push({name:"CueTime",type:"u",data:pe(nn)}),Rt.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Rt.push({name:"CueTrack",type:"u",data:pe(fn)}),tn-=Le,tn+=Zt,Rt.push({name:"CueClusterPosition",type:"u",data:pe(tn)}),Rt.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Rt.push({name:"CuePoint",type:"m",isEnd:!0})}),Rt.push({name:"Cues",type:"m",isEnd:!0}),Vt=ce(Rt),Pe!==Zt){if(Pe=Zt,st===it-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Bt=0;Bt<it;Bt++){var nt=zt(Bt);if(nt==="break")break}var et=[].concat.apply([],[We,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},rt,Et,jt,Rt]),ot=new q.default().encode(et);return ot}N.makeMetadataSeekable=te;function ne(be,Se){for(var Me=-1,We=0;We<Se.length;We++){var Je=Se[We];if(Je.name===be)if(Je.type==="m")if(!Je.isEnd)Me=We;else{if(Me==-1)throw new Error("Detected ".concat(be," closing element before finding the start"));Se.splice(Me,We-Me+1);return}else{Se.splice(We,1);return}}}N.removeElement=ne;function ee(be,Se){for(var Me=[],We=-1,Je=0;Je<Se.length;Je++){var Le=Se[Je];if(Le.name===be)if(Le.type==="m")if(!Le.isEnd)We=Je;else{if(We==-1)throw new Error("Detected ".concat(be," closing element before finding the start"));Me=Se.slice(We,Je+1);break}else{Me.push(Se[Je]);break}}return Me}N.extractElement=ee;function re(be,Se){Array.isArray(Se.cueInfos)&&!Array.isArray(Se.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),Se.cues=Se.cueInfos);for(var Me=[],We=[],Je=0;Je<be.length;Je++){var Le=be[Je];if(Le.type==="m"&&Le.name==="Segment"){if(Me=be.slice(0,Je),We=be.slice(Je),Le.unknownSize){We.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(We[We.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Tt=We[We.length-1].dataEnd,Et=Me[Me.length-1].dataEnd,At=new q.default().encode(Me).byteLength,jt=At-Et,Pt=Tt-We[0].tagStart;We[0].tagStart-Et,We[0].tagStart;var _t=new N.Buffer([24,83,128,103]),rt=new N.Buffer("01ffffffffffffff","hex"),Vt=_t.byteLength+rt.byteLength,Rt=Pt,Pe;for(Pe=1;Pe<20;Pe++){var it=Et+Vt+Rt,zt=it-Tt,Bt=jt+zt,nt=oe(We,Bt,Se),et=new q.default().encode(nt).byteLength;if(et===Rt)return new q.default().encode([].concat(Me,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],nt));Rt=et}throw new Error("unable to refine metadata, stable size could not be found in "+Pe+" iterations!")}N.putRefinedMetaData=re;function ce(be){var Se=new q.default;return be.reduce(function(Me,We){return Me.concat(Se.encode([We]))},[]).reduce(function(Me,We){return Me+We.byteLength},0)}function oe(be,Se,Me){var We=Me.duration,Je=Me.clusterPtrs,Le=Me.cues,Tt=be.slice(0);if(typeof We=="number"){var Et=!1;Tt.forEach(function(jt){jt.type==="f"&&jt.name==="Duration"&&(Et=!0,jt.data=we(We,8))}),Et||ge(Tt,"Info",[{name:"Duration",type:"f",data:we(We,8)}])}Array.isArray(Le)&&ge(Tt,"Cues",fe(Le,Se));var At=[];return Array.isArray(Je)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),At=se(Je,Se)),ge(Tt,"SeekHead",At,!0),Tt}function se(be,Se){var Me=[];return be.forEach(function(We){Me.push({name:"Seek",type:"m",isEnd:!1}),Me.push({name:"SeekID",type:"b",data:new N.Buffer([31,67,182,117])}),Me.push({name:"SeekPosition",type:"u",data:pe(We+Se)}),Me.push({name:"Seek",type:"m",isEnd:!0})}),Me}function fe(be,Se){var Me=[];return be.forEach(function(We){var Je=We.CueTrack,Le=We.CueClusterPosition,Tt=We.CueTime;Me.push({name:"CuePoint",type:"m",isEnd:!1}),Me.push({name:"CueTime",type:"u",data:pe(Tt)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Me.push({name:"CueTrack",type:"u",data:pe(Je)}),Me.push({name:"CueClusterPosition",type:"u",data:pe(Le+Se)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Me.push({name:"CuePoint",type:"m",isEnd:!0})}),Me}function ge(be,Se,Me,We){We===void 0&&(We=!1);for(var Je=-1,Le=0;Le<be.length;Le++){var Tt=be[Le];if(Tt.type==="m"&&Tt.name===Se&&Tt.isEnd===!1){Je=Le;break}}Je>=0?Array.prototype.splice.apply(be,[Je+1,0].concat(Me)):We?[].concat([{name:Se,type:"m",isEnd:!1}],Me,[{name:Se,type:"m",isEnd:!0}]).reverse().forEach(function(Et){be.unshift(Et)}):(be.push({name:Se,type:"m",isEnd:!1}),Me.forEach(function(Et){be.push(Et)}),be.push({name:Se,type:"m",isEnd:!0}))}function ue(be){return N.Buffer.concat(be)}N.concat=ue;function _e(be){var Se=new N.Buffer(0);if(be.type==="m")return be;switch(be.type){case"u":Se=pe(be.value);break;case"i":Se=ye(be.value);break;case"f":Se=we(be.value);break;case"s":Se=new N.Buffer(be.value,"ascii");break;case"8":Se=new N.Buffer(be.value,"utf8");break;case"b":Se=be.value;break;case"d":Se=new Z.Int64BE(be.value.getTime().toString()).toBuffer();break}return Object.assign({},be,{data:Se})}N.encodeValueToBuffer=_e;function pe(be){for(var Se=1;be>=Math.pow(2,8*Se);Se++);if(Se>=7)return console.warn("7bit or more bigger uint not supported."),new Z.Uint64BE(be).toBuffer();var Me=new N.Buffer(Se);return Me.writeUIntBE(be,0,Se),Me}N.createUIntBuffer=pe;function ye(be){for(var Se=1;be>=Math.pow(2,8*Se);Se++);if(Se>=7)return console.warn("7bit or more bigger uint not supported."),new Z.Int64BE(be).toBuffer();var Me=new N.Buffer(Se);return Me.writeIntBE(be,0,Se),Me}N.createIntBuffer=ye;function we(be,Se){if(Se===void 0&&(Se=8),Se===8){var Me=new N.Buffer(8);return Me.writeDoubleBE(be,0),Me}else if(Se===4){var Me=new N.Buffer(4);return Me.writeFloatBE(be,0),Me}else throw new Error("float type bits must 4bytes or 8bytes")}N.createFloatBuffer=we;function Ie(be){return be instanceof Date?be:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(be)/1e3/1e3)}N.convertEBMLDateToJSDate=Ie}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var N=requireInt64Buffer(),Z=requireTools(),q=requireTools(),J=requireEbmlID(),I;(function(a){a[a.STATE_TAG=1]="STATE_TAG",a[a.STATE_SIZE=2]="STATE_SIZE",a[a.STATE_CONTENT=3]="STATE_CONTENT"})(I||(I={}));var D=function(){function a(){this._buffer=new Z.Buffer(0),this._tag_stack=[],this._state=I.STATE_TAG,this._cursor=0,this._total=0,this._schema=J.byEbmlID,this._result=[]}return a.prototype.decode=function(O){this.readChunk(O);var F=this._result;return this._result=[],F},a.prototype.readChunk=function(O){for(this._buffer=q.concat([this._buffer,new Z.Buffer(O)]);this._cursor<this._buffer.length&&!(this._state===I.STATE_TAG&&!this.readTag()||this._state===I.STATE_SIZE&&!this.readSize()||this._state===I.STATE_CONTENT&&!this.readContent()););},a.prototype.getSchemaInfo=function(O){return this._schema[O]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},a.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var O=(0,Z.readVint)(this._buffer,this._cursor);if(O==null)return!1;var F=this._buffer.slice(this._cursor,this._cursor+O.length),z=F.reduce(function(ne,ee,re,ce){return ne+ee*Math.pow(16,2*(ce.length-1-re))},0),K=this.getSchemaInfo(z),te={EBML_ID:z.toString(16),schema:K,type:K.type,name:K.name,level:K.level,tagStart:this._total,tagEnd:this._total+O.length,sizeStart:this._total+O.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(te),this._cursor+=O.length,this._total+=O.length,this._state=I.STATE_SIZE,!0},a.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var O=(0,Z.readVint)(this._buffer,this._cursor);if(O==null)return!1;var F=this._tag_stack[this._tag_stack.length-1];return F.sizeEnd=F.sizeStart+O.length,F.dataStart=F.sizeEnd,F.dataSize=O.value,O.value===-1?(F.dataEnd=-1,F.type==="m"&&(F.unknownSize=!0)):F.dataEnd=F.sizeEnd+O.value,this._cursor+=O.length,this._total+=O.length,this._state=I.STATE_CONTENT,!0},a.prototype.readContent=function(){var O=this._tag_stack[this._tag_stack.length-1];if(O.type==="m"){if(O.isEnd=!1,this._result.push(O),this._state=I.STATE_TAG,O.dataSize===0){var F=Object.assign({},O,{isEnd:!0});this._result.push(F),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+O.dataSize)return!1;var z=this._buffer.slice(this._cursor,this._cursor+O.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+O.dataSize),O.data=z,O.type){case"u":O.value=z.readUIntBE(0,z.length);break;case"i":O.value=z.readIntBE(0,z.length);break;case"f":O.value=O.dataSize===4?z.readFloatBE(0):O.dataSize===8?z.readDoubleBE(0):(console.warn("cannot read ".concat(O.dataSize," octets float. failback to 0")),0);break;case"s":O.value=z.toString("ascii");break;case"8":O.value=z.toString("utf8");break;case"b":O.value=z;break;case"d":O.value=(0,Z.convertEBMLDateToJSDate)(new N.Int64BE(z).toNumber());break}if(O.value===null)throw new Error("unknown tag type:"+O.type);for(this._result.push(O),this._total+=O.dataSize,this._state=I.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var K=this._tag_stack[this._tag_stack.length-1];if(K.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<K.dataEnd)break;if(K.type!=="m")throw new Error("parent element is not master element");var F=Object.assign({},K,{isEnd:!0});this._result.push(F),this._tag_stack.pop()}return!0},a}();return EBMLDecoder.default=D,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var N=typeof Reflect=="object"?Reflect:null,Z=N&&typeof N.apply=="function"?N.apply:function(_e,pe,ye){return Function.prototype.apply.call(_e,pe,ye)},q;N&&typeof N.ownKeys=="function"?q=N.ownKeys:Object.getOwnPropertySymbols?q=function(_e){return Object.getOwnPropertyNames(_e).concat(Object.getOwnPropertySymbols(_e))}:q=function(_e){return Object.getOwnPropertyNames(_e)};function J(ue){console&&console.warn&&console.warn(ue)}var I=Number.isNaN||function(_e){return _e!==_e};function D(){D.init.call(this)}events.exports=D,events.exports.once=se,D.EventEmitter=D,D.prototype._events=void 0,D.prototype._eventsCount=0,D.prototype._maxListeners=void 0;var a=10;function O(ue){if(typeof ue!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ue)}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(ue){if(typeof ue!="number"||ue<0||I(ue))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ue+".");a=ue}}),D.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},D.prototype.setMaxListeners=function(_e){if(typeof _e!="number"||_e<0||I(_e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_e+".");return this._maxListeners=_e,this};function F(ue){return ue._maxListeners===void 0?D.defaultMaxListeners:ue._maxListeners}D.prototype.getMaxListeners=function(){return F(this)},D.prototype.emit=function(_e){for(var pe=[],ye=1;ye<arguments.length;ye++)pe.push(arguments[ye]);var we=_e==="error",Ie=this._events;if(Ie!==void 0)we=we&&Ie.error===void 0;else if(!we)return!1;if(we){var be;if(pe.length>0&&(be=pe[0]),be instanceof Error)throw be;var Se=new Error("Unhandled error."+(be?" ("+be.message+")":""));throw Se.context=be,Se}var Me=Ie[_e];if(Me===void 0)return!1;if(typeof Me=="function")Z(Me,this,pe);else for(var We=Me.length,Je=re(Me,We),ye=0;ye<We;++ye)Z(Je[ye],this,pe);return!0};function z(ue,_e,pe,ye){var we,Ie,be;if(O(pe),Ie=ue._events,Ie===void 0?(Ie=ue._events=Object.create(null),ue._eventsCount=0):(Ie.newListener!==void 0&&(ue.emit("newListener",_e,pe.listener?pe.listener:pe),Ie=ue._events),be=Ie[_e]),be===void 0)be=Ie[_e]=pe,++ue._eventsCount;else if(typeof be=="function"?be=Ie[_e]=ye?[pe,be]:[be,pe]:ye?be.unshift(pe):be.push(pe),we=F(ue),we>0&&be.length>we&&!be.warned){be.warned=!0;var Se=new Error("Possible EventEmitter memory leak detected. "+be.length+" "+String(_e)+" listeners added. Use emitter.setMaxListeners() to increase limit");Se.name="MaxListenersExceededWarning",Se.emitter=ue,Se.type=_e,Se.count=be.length,J(Se)}return ue}D.prototype.addListener=function(_e,pe){return z(this,_e,pe,!1)},D.prototype.on=D.prototype.addListener,D.prototype.prependListener=function(_e,pe){return z(this,_e,pe,!0)};function K(){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 te(ue,_e,pe){var ye={fired:!1,wrapFn:void 0,target:ue,type:_e,listener:pe},we=K.bind(ye);return we.listener=pe,ye.wrapFn=we,we}D.prototype.once=function(_e,pe){return O(pe),this.on(_e,te(this,_e,pe)),this},D.prototype.prependOnceListener=function(_e,pe){return O(pe),this.prependListener(_e,te(this,_e,pe)),this},D.prototype.removeListener=function(_e,pe){var ye,we,Ie,be,Se;if(O(pe),we=this._events,we===void 0)return this;if(ye=we[_e],ye===void 0)return this;if(ye===pe||ye.listener===pe)--this._eventsCount===0?this._events=Object.create(null):(delete we[_e],we.removeListener&&this.emit("removeListener",_e,ye.listener||pe));else if(typeof ye!="function"){for(Ie=-1,be=ye.length-1;be>=0;be--)if(ye[be]===pe||ye[be].listener===pe){Se=ye[be].listener,Ie=be;break}if(Ie<0)return this;Ie===0?ye.shift():ce(ye,Ie),ye.length===1&&(we[_e]=ye[0]),we.removeListener!==void 0&&this.emit("removeListener",_e,Se||pe)}return this},D.prototype.off=D.prototype.removeListener,D.prototype.removeAllListeners=function(_e){var pe,ye,we;if(ye=this._events,ye===void 0)return this;if(ye.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ye[_e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ye[_e]),this;if(arguments.length===0){var Ie=Object.keys(ye),be;for(we=0;we<Ie.length;++we)be=Ie[we],be!=="removeListener"&&this.removeAllListeners(be);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(pe=ye[_e],typeof pe=="function")this.removeListener(_e,pe);else if(pe!==void 0)for(we=pe.length-1;we>=0;we--)this.removeListener(_e,pe[we]);return this};function ne(ue,_e,pe){var ye=ue._events;if(ye===void 0)return[];var we=ye[_e];return we===void 0?[]:typeof we=="function"?pe?[we.listener||we]:[we]:pe?oe(we):re(we,we.length)}D.prototype.listeners=function(_e){return ne(this,_e,!0)},D.prototype.rawListeners=function(_e){return ne(this,_e,!1)},D.listenerCount=function(ue,_e){return typeof ue.listenerCount=="function"?ue.listenerCount(_e):ee.call(ue,_e)},D.prototype.listenerCount=ee;function ee(ue){var _e=this._events;if(_e!==void 0){var pe=_e[ue];if(typeof pe=="function")return 1;if(pe!==void 0)return pe.length}return 0}D.prototype.eventNames=function(){return this._eventsCount>0?q(this._events):[]};function re(ue,_e){for(var pe=new Array(_e),ye=0;ye<_e;++ye)pe[ye]=ue[ye];return pe}function ce(ue,_e){for(;_e+1<ue.length;_e++)ue[_e]=ue[_e+1];ue.pop()}function oe(ue){for(var _e=new Array(ue.length),pe=0;pe<_e.length;++pe)_e[pe]=ue[pe].listener||ue[pe];return _e}function se(ue,_e){return new Promise(function(pe,ye){function we(be){ue.removeListener(_e,Ie),ye(be)}function Ie(){typeof ue.removeListener=="function"&&ue.removeListener("error",we),pe([].slice.call(arguments))}ge(ue,_e,Ie,{once:!0}),_e!=="error"&&fe(ue,we,{once:!0})})}function fe(ue,_e,pe){typeof ue.on=="function"&&ge(ue,"error",_e,pe)}function ge(ue,_e,pe,ye){if(typeof ue.on=="function")ye.once?ue.once(_e,pe):ue.on(_e,pe);else if(typeof ue.addEventListener=="function")ue.addEventListener(_e,function we(Ie){ye.once&&ue.removeEventListener(_e,we),pe(Ie)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ue)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var N=EBMLReader&&EBMLReader.__extends||function(){var I=function(D,a){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(O,F){O.__proto__=F}||function(O,F){for(var z in F)Object.prototype.hasOwnProperty.call(F,z)&&(O[z]=F[z])},I(D,a)};return function(D,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");I(D,a);function O(){this.constructor=D}D.prototype=a===null?Object.create(a):(O.prototype=a.prototype,new O)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var Z=requireEvents(),q=requireTools(),J=function(I){N(D,I);function D(){var a=I.call(this)||this;return a.logGroup="",a.hasLoggingStarted=!1,a.metadataloaded=!1,a.chunks=[],a.stack=[],a.segmentOffset=0,a.last2SimpleBlockVideoTrackTimecode=[0,0],a.last2SimpleBlockAudioTrackTimecode=[0,0],a.lastClusterTimecode=0,a.lastClusterPosition=0,a.timecodeScale=1e6,a.metadataSize=0,a.metadatas=[],a.cues=[],a.firstVideoBlockRead=!1,a.firstAudioBlockRead=!1,a.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},a.trackTypes=[],a.trackDefaultDuration=[],a.trackCodecDelay=[],a.trackInfo={type:"nothing"},a.ended=!1,a.logging=!1,a.use_duration_every_simpleblock=!1,a.use_webp=!1,a.use_segment_info=!0,a.drop_default_duration=!0,a}return D.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()},D.prototype.emit_segment_info=function(){var a=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var z=this.lastClusterTimecode,K=this.duration,te=this.timecodeScale;this.emit("cluster",{timecode:z,data:a}),this.emit("duration",{timecodeScale:te,duration:K})}else{this.metadataloaded=!0,this.metadatas=a;var O=this.trackTypes.indexOf(1),F=this.trackTypes.indexOf(2);if(this.trackInfo=O>=0&&F>=0?{type:"both",trackNumber:O}:O>=0?{type:"video",trackNumber:O}:F>=0?{type:"audio",trackNumber:F}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:a,metadataSize:this.metadataSize})}},D.prototype.read=function(a){var O=this,F=!1;if(!this.ended){if(a.type==="m")if(a.isEnd)this.stack.pop();else{var z=this.stack[this.stack.length-1];if(z!=null&&z.level>=a.level){this.stack.pop(),this.logging&&console.groupEnd(),z.dataEnd=a.dataEnd,z.dataSize=a.dataEnd-z.dataStart,z.unknownSize=!1;var K=Object.assign({},z,{name:z.name,type:z.type,isEnd:!0});this.chunks.push(K)}this.stack.push(a)}if(a.type==="m"&&a.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=a.dataStart,this.emit("segment_offset",this.segmentOffset);else if(a.type==="b"&&a.name==="SimpleBlock"){var te=q.ebmlBlock(a.data),ne=te.timecode,ee=te.trackNumber,re=te.frames;if(this.trackTypes[ee]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ce=this.lastClusterTimecode+ne;this.cues.push({CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:ce}),this.emit("cue_info",{CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:ce})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],ne]}else if(this.trackTypes[ee]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ce=this.lastClusterTimecode+ne;this.cues.push({CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:ce}),this.emit("cue_info",{CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:ee,CueClusterPosition:this.lastClusterPosition,CueTime:ce})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],ne]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&re.forEach(function(oe){var se=oe.slice(3,6).toString("hex");if(se==="9d012a"){var fe=q.VP8BitStreamToRiffWebPBuffer(oe),ge=new Blob([fe],{type:"image/webp"}),ue=O.duration;O.emit("webp",{currentTime:ue,webp:ge})}})}else a.type==="m"&&a.name==="Cluster"&&a.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",a.tagStart),this.lastClusterPosition=a.tagStart):a.type==="u"&&a.name==="Timecode"?this.lastClusterTimecode=a.value:a.type==="u"&&a.name==="TimecodeScale"?this.timecodeScale=a.value:a.type==="m"&&a.name==="TrackEntry"?a.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}:a.type==="u"&&a.name==="TrackType"?this.currentTrack.TrackType=a.value:a.type==="u"&&a.name==="TrackNumber"?this.currentTrack.TrackNumber=a.value:a.type==="u"&&a.name==="CodecDelay"?this.currentTrack.CodecDelay=a.value:a.type==="u"&&a.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),F=!0):this.currentTrack.DefaultDuration=a.value:a.name==="unknown"&&console.warn(a);!this.metadataloaded&&a.dataEnd>0&&(this.metadataSize=a.dataEnd),F||this.chunks.push(a),this.logging&&this.put(a)}},Object.defineProperty(D.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var a=0,O=0,F=0,z=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof z=="number")a=z;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){a=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var K=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof K=="number"&&(O=K),F=this.last2SimpleBlockAudioTrackTimecode[1]}else{a=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var K=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof K=="number"&&(O=K),F=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){a=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var K=this.trackCodecDelay[this.trackInfo.trackNumber];typeof K=="number"&&(O=K),F=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){a=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var K=this.trackCodecDelay[this.trackInfo.trackNumber];typeof K=="number"&&(O=K),F=this.last2SimpleBlockAudioTrackTimecode[1]}var te=(this.lastClusterTimecode+F)*this.timecodeScale+a-O,ne=te/this.timecodeScale;return Math.floor(ne)},enumerable:!1,configurable:!0}),D.prototype.addListener=function(a,O){return I.prototype.addListener.call(this,a,O)},D.prototype.put=function(a){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),a.type==="m"?a.isEnd?console.groupEnd():console.group(a.name+":"+a.tagStart):a.type==="b"?console.log(a.name,a.type):console.log(a.name,a.tagStart,a.type,a.value)},D}(Z.EventEmitter);return EBMLReader.default=J,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(N){var Z=ebml&&ebml.__createBinding||(Object.create?function(O,F,z,K){K===void 0&&(K=z),Object.defineProperty(O,K,{enumerable:!0,get:function(){return F[z]}})}:function(O,F,z,K){K===void 0&&(K=z),O[K]=F[z]}),q=ebml&&ebml.__exportStar||function(O,F){for(var z in O)z!=="default"&&!Object.prototype.hasOwnProperty.call(F,z)&&Z(F,O,z)};Object.defineProperty(N,"__esModule",{value:!0}),N.tools=N.Reader=N.Encoder=N.Decoder=void 0,q(requireEBML(),N);var J=requireEBMLDecoder();N.Decoder=J.default;var I=requireEBMLEncoder();N.Encoder=I.default;var D=requireEBMLReader();N.Reader=D.default;var a=requireTools();N.tools=a}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var N=lib&&lib.__awaiter||function(I,D,a,O){function F(z){return z instanceof a?z:new a(function(K){K(z)})}return new(a||(a=Promise))(function(z,K){function te(re){try{ee(O.next(re))}catch(ce){K(ce)}}function ne(re){try{ee(O.throw(re))}catch(ce){K(ce)}}function ee(re){re.done?z(re.value):F(re.value).then(te,ne)}ee((O=O.apply(I,D||[])).next())})},Z=lib&&lib.__generator||function(I,D){var a={label:0,sent:function(){if(z[0]&1)throw z[1];return z[1]},trys:[],ops:[]},O,F,z,K;return K={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(K[Symbol.iterator]=function(){return this}),K;function te(ee){return function(re){return ne([ee,re])}}function ne(ee){if(O)throw new TypeError("Generator is already executing.");for(;a;)try{if(O=1,F&&(z=ee[0]&2?F.return:ee[0]?F.throw||((z=F.return)&&z.call(F),0):F.next)&&!(z=z.call(F,ee[1])).done)return z;switch(F=0,z&&(ee=[ee[0]&2,z.value]),ee[0]){case 0:case 1:z=ee;break;case 4:return a.label++,{value:ee[1],done:!1};case 5:a.label++,F=ee[1],ee=[0];continue;case 7:ee=a.ops.pop(),a.trys.pop();continue;default:if(z=a.trys,!(z=z.length>0&&z[z.length-1])&&(ee[0]===6||ee[0]===2)){a=0;continue}if(ee[0]===3&&(!z||ee[1]>z[0]&&ee[1]<z[3])){a.label=ee[1];break}if(ee[0]===6&&a.label<z[1]){a.label=z[1],z=ee;break}if(z&&a.label<z[2]){a.label=z[2],a.ops.push(ee);break}z[2]&&a.ops.pop(),a.trys.pop();continue}ee=D.call(I,a)}catch(re){ee=[6,re],F=0}finally{O=z=0}if(ee[0]&5)throw ee[1];return{value:ee[0]?ee[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var q=requireEbml();function J(I){return N(this,void 0,void 0,function(){var D,a,O,F,z,K,te,ne,ee,re,ce,oe;return Z(this,function(se){switch(se.label){case 0:if(!I)throw Error("call to fixWebmDuration requires a blob");D=new q.Decoder,a=new q.Reader,O=I.stream(),F=O.getReader(),se.label=1;case 1:return[4,F.read()];case 2:return z=se.sent(),K=z.done,te=z.value,K?(a.stop(),[3,3]):(ne=D.decode(te),ne=ne==null?void 0:ne.filter(function(fe){return fe.type!=="unknown"}),ne.forEach(function(fe){a.read(fe)}),te=null,[3,1]);case 3:return ee=q.tools.makeMetadataSeekable(a.metadatas,a.duration,a.cues),re=new Blob([ee],{type:I.type}),ce=I.slice(a.metadataSize),oe=new Blob([re,ce],{type:I.type}),[2,oe]}})})}return lib.default=J,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){at(this,Xt);at(this,mn,!1);at(this,hn,!1);at(this,In,0);at(this,xn,0);at(this,sn,0);at(this,ln,0);at(this,yn,0);Ee(this,"onchange",Z=>{});Ee(this,"onDurationChange",Z=>{});Ee(this,"start",async(Z="")=>{Z||(Z=`video_Record_${E$1(Date.now())}`);let q=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(J=>{const I=J.getTracks();for(const a of I)a.onended=()=>this.stop();Ct(this,mn,!0),Ct(this,hn,!1),Ct(this,Xt,new MediaRecorder(J)),De(this,Xt).start();const D=new Date().getTime();Ct(this,In,D),Ct(this,sn,D),De(this,vn).call(this),De(this,Rn).call(this),De(this,Xt).addEventListener("dataavailable",a=>{q.push(a.data)}),De(this,Xt).addEventListener("stop",async()=>{Ct(this,mn,!1);const a=new Date().getTime();Ct(this,xn,a),Ct(this,ln,De(this,ln)+(a-De(this,sn))),De(this,vn).call(this),clearInterval(De(this,yn));const O=J.getTracks();for(const ne of O)ne.stop();if(De(this,Xt)===null)return;const F=new Blob(q,{type:De(this,Xt).mimeType}),z=await fixWebmDuration(F),K=URL.createObjectURL(z),te=document.createElement("a");te.href=K,te.download=`${Z}.mp4`,te.click(),URL.revokeObjectURL(K),q=[],Ct(this,Xt,null)})})});Ee(this,"pause",async()=>{var q;await new Promise(J=>setTimeout(()=>J(!0),300)),(q=De(this,Xt))==null||q.pause(),Ct(this,hn,!0);const Z=new Date().getTime();Ct(this,ln,De(this,ln)+(Z-De(this,sn))),De(this,vn).call(this),clearInterval(De(this,yn))});Ee(this,"resume",async()=>{var q;(q=De(this,Xt))==null||q.resume(),Ct(this,hn,!1);const Z=new Date().getTime();Ct(this,sn,Z),De(this,vn).call(this),De(this,Rn).call(this)});Ee(this,"stop",async()=>{var Z;(Z=De(this,Xt))==null||Z.stop()});Ee(this,"getDuration",()=>{if(De(this,sn)===0)return 0;let Z=De(this,ln);const q=new Date().getTime();if(De(this,mn)&&De(this,hn)===!1){const J=q-De(this,sn);Ct(this,sn,q),Z=Z+J}return Z});Ee(this,"getInfo",()=>({active:De(this,mn),pause:De(this,hn),startTime:De(this,In),endTime:De(this,xn),duration:De(this,ln)}));at(this,vn,()=>{const Z=this.getInfo();this.onchange(Z)});at(this,Rn,()=>{clearInterval(De(this,yn)),Ct(this,yn,window.setInterval(()=>{Ct(this,ln,this.getDuration()),this.onDurationChange(De(this,ln))},500))})}}Xt=new WeakMap,mn=new WeakMap,hn=new WeakMap,In=new WeakMap,xn=new WeakMap,sn=new WeakMap,ln=new WeakMap,yn=new WeakMap,vn=new WeakMap,Rn=new WeakMap;class RoomBase{constructor(Z){Ee(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});Ee(this,"sdk_service_version","1.0.6");Ee(this,"prohibitNotify",!1);Ee(this,"isEarly",!1);Ee(this,"isInRoom",!1);Ee(this,"taskQueue");Ee(this,"roomState","ready");Ee(this,"createAt",Date.now());Ee(this,"cwsIns");Ee(this,"peerIns");Ee(this,"transceiverMap",new Map);Ee(this,"sendChannel");Ee(this,"receiveChannel");Ee(this,"userMap",new Map);Ee(this,"setLocalStreamActiveMap",new Map);Ee(this,"phoneyStreams",new Map);Ee(this,"recorder",new StreamRecorder);Ee(this,"networkQualityTester",new NetworkQualityTester);Ee(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Ee(this,"reportLogs",(Z,q="未知错误")=>{const{appid:J,userId:I,earlyId:D="",logUrl:a,reportErr:O}=this.options;if(!O)return;const F="web",z=K=>({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})[K].toString();{const K=z(Z),te={origin:F,type:K,app_id:J,user_id:I,ins_id:D,desc:q},ne=btoa(encodeURI(JSON.stringify(te))),ee=`${a}/upload/log?log_key=${ne}`;{const re=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),oe=new TextEncoder().encode(re),se=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:te,url:ee,size:lt(se.byteLength)}),fetch(ee,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:se})}}});Ee(this,"initPhoneyStreams",(Z,q=[])=>{q.length===0&&(q=mediaType_keys);for(const J of q){const I=this.phoneyStreams.get(J);if(I){const D=I.getTracks();for(const a of D)a.stop()}switch(J){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(Z));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(Z));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Ee(this,"getPhoneyStreams",Z=>this.phoneyStreams.get(Z));Ee(this,"getRoomInfo",()=>{const{options:Z,roomState:q,createAt:J}=this;return{...Z,roomState:q,createAt:J}});Ee(this,"setRoomState",Z=>{this.roomState=Z;const q=enum_roomState[Z],J={state:Z,stateStr:q};this.cwsIns.emitNotify("onRoomState",{code:200,data:J,desc:"room state is change."})});Ee(this,"setOptions",async Z=>{const q={...this.options,...Z};this.options=q});Ee(this,"stopStream",async Z=>{const q=Z.getTracks();for(const J of q)J.stop()});Ee(this,"getMediaDevicesErrInfo",async()=>{try{const Z=await navigator.mediaDevices.enumerateDevices();Z.find(J=>J.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),Z.find(J=>J.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(Z){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",Z)}return this.mediaDevicesErrInfo});Ee(this,"getUserMediaKey",(Z,q)=>`${Z}-${q}`);Ee(this,"getCallAction",async Z=>{let q="";const J=D=>Z.findIndex(({type:O,enabled:F=!0})=>O===D&&F)===-1?"0":"1";return q=`${J(0)}${q}`,q=`${J(1)}${q}`,q=`${J(2)}${q}`,q=`${J(3)}${q}`,parseInt(q,2)});Ee(this,"getCallActionMap",(Z=0)=>{const J=Number(Z).toString(2).padStart(4,"0").split(""),[I,D,a,O]=J;return{microphoneCamera_audio:!!Number(O),microphoneCamera_video:!!Number(a),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(I)}});Ee(this,"getBanBehaviorMap",(Z=0)=>{const J=Number(Z).toString(2).padStart(4,"0").split(""),[I,D,a,O]=J;return{microphoneCamera_audio:!!Number(O),microphoneCamera_video:!!Number(a),screenSharing_video:!!Number(D),screenSharing_audio:!!Number(I)}});Ee(this,"getAverageVolume",(Z,q)=>{Z.getByteFrequencyData(q);let J=0;for(let D=0;D<q.length;D++)J+=q[D];return Math.ceil(J/q.length)});Ee(this,"getTrackNamesFormTracks",(Z,q=[],J="trackName")=>{const I=[];for(const D of Z){const{type:a}=D;if(q.length===0||q.includes(a)){const O=D[J];O&&I.push(`${O}`)}}return I});Ee(this,"usersFilter",Z=>dt(Z,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((I,D)=>I.id.localeCompare(D.id,"en")));this.setOptions(Z),this.cwsIns=new CallsWebSocket({...Z}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:Z.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1),this.options.debug&&this.networkQualityTester.testAll().then(q=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: networkQualityTester",q)})}}var m=Object.defineProperty,G=(N,Z,q)=>Z in N?m(N,Z,{enumerable:!0,configurable:!0,writable:!0,value:q}):N[Z]=q,e$1=(N,Z,q)=>G(N,typeof Z!="symbol"?Z+"":Z,q);class g{constructor(Z,q){e$1(this,"inputStream",new MediaStream),e$1(this,"outputStream",new MediaStream),e$1(this,"inputGain",1),e$1(this,"enhanceGain",1),e$1(this,"bgsGain",1),e$1(this,"bgmGain",1),e$1(this,"outputGain",1),e$1(this,"mixAudioMap",new Map),e$1(this,"audioContext",new AudioContext),e$1(this,"sourceNode"),e$1(this,"inputGainNode"),e$1(this,"enhanceGainNode"),e$1(this,"bgsGainNode"),e$1(this,"bgmGainNode"),e$1(this,"analyserNode"),e$1(this,"analyserArrayData"),e$1(this,"outputGainNode"),e$1(this,"destinationNode"),e$1(this,"filterStream",J=>J),e$1(this,"stop",()=>{{const J=this.inputStream.getTracks();for(const I of J)I.stop(),this.inputStream.removeTrack(I)}}),e$1(this,"getStream",()=>this.filterStream(this.outputStream)),e$1(this,"setMute",(J=!0)=>{J?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e$1(this,"setInputGain",J=>{this.inputGain=J,this.inputGainNode.gain.setValueAtTime(J,this.audioContext.currentTime)}),e$1(this,"setEnhanceGain",async J=>{this.enhanceGain=J+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e$1(this,"setBgsGain",J=>{this.bgsGain=J,this.bgsGainNode.gain.setValueAtTime(J,this.audioContext.currentTime)}),e$1(this,"setBgmGain",J=>{this.bgmGain=J,this.bgmGainNode.gain.setValueAtTime(J,this.audioContext.currentTime)}),e$1(this,"setOutputGain",J=>{this.outputGain=J,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e$1(this,"getVolume",()=>{const{analyserNode:J,analyserArrayData:I}=this;J.getByteFrequencyData(I);let D=0;for(let a=0;a<I.length;a++)D+=I[a];return Math.ceil(D/I.length)}),e$1(this,"mixAudio",(J,I="bgm")=>new Promise(async(D,a)=>{try{{const z=this.mixAudioMap.get(I);z&&z.stop()}const O=I==="bgs"?this.bgsGainNode:this.bgmGainNode,F=this.audioContext.createBufferSource();this.mixAudioMap.set(I,F),F.buffer=J,F.connect(O),F.onended=()=>{F.disconnect(O),this.mixAudioMap.delete(I),D(!0)},F.start(0)}catch(O){a(O)}})),e$1(this,"mixAudioStop",J=>{const I=this.mixAudioMap.get(J);I==null||I.stop()}),e$1(this,"changeMix",(J,I)=>{const D=J==="bgs"?this.bgsGainNode:this.bgmGainNode;I?D.connect(this.destinationNode):D.disconnect(this.destinationNode)}),q&&(this.audioContext=q),this.inputStream=Z,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:J,inputGainNode:I,enhanceGainNode:D,bgsGainNode:a,bgmGainNode:O,analyserNode:F,outputGainNode:z,destinationNode:K}=this;J.connect(I),I.connect(D),D.connect(F),a.connect(F),O.connect(F),D.connect(K),a.connect(K),O.connect(K),F.connect(z),z.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(q){super(q);at(this,wn,[]);at(this,en,new Map);at(this,Ht,new Map);at(this,cn,new Map);at(this,un,new Map);at(this,pn,new Map);Ee(this,"localStreamsActionMap",new Map);at(this,kn,new Map);Ee(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Ee(this,"initMediaPhoneyStreams",(q=[])=>this.initPhoneyStreams(this.audioContext,q));Ee(this,"initLocalStreamsFilter",()=>{for(const q of mediaType_keys){const J=async I=>I;De(this,kn).set(q,J)}});Ee(this,"setLocalFilterStream",(q,J)=>{De(this,kn).set(q,J)});at(this,Un,()=>{De(this,Ht).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),De(this,Ht).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),De(this,Ht).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),De(this,Ht).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});at(this,Ln,()=>{De(this,en).set("audioinput","default"),De(this,en).set("videoinput","default"),De(this,en).set("audiooutput","default")});Ee(this,"emitNotifyUpdateUsersStreams",async q=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:q,desc:"users streams is change."})});Ee(this,"initUserMediaStreamContext",async(q,J,I)=>{const[D]=I.getTracks();if(!D){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:q,mediaType:J,stream:I});return}this.removeUserMediaStreamContext(q,J);const a=this.getUserMediaKey(q,J),{kind:O}=D;switch(O){case"audio":{const F=new MediaStream;F.addTrack(D);const z=new g(F,this.audioContext);De(this,cn).set(a,z)}break;case"video":{const F=new VideoMediaContext(D);De(this,un).set(a,F)}break}});Ee(this,"getUserMediaStreamContext",(q,J)=>{const I=this.getUserMediaKey(q,J);if(["microphoneCamera_audio","screenSharing_audio"].includes(J))return De(this,cn).get(I);if(["microphoneCamera_video","screenSharing_video"].includes(J))return De(this,un).get(I)});Ee(this,"getUserAudioMediaStreamContext",(q,J)=>{const I=this.getUserMediaKey(q,J);return De(this,cn).get(I)});Ee(this,"removeUserMediaStreamContext",(q,J)=>{const I=this.getUserMediaKey(q,J);if(["microphoneCamera_audio","screenSharing_audio"].includes(J)){const D=De(this,cn).get(I);return D==null||D.stop(),De(this,cn).delete(I)}if(["microphoneCamera_video","screenSharing_video"].includes(J)){const D=De(this,un).get(I);return D==null||D.stop(),De(this,un).get(I)}});Ee(this,"getUserStream",(q,J)=>{const I=this.getUserMediaStreamContext(q,J);return(I==null?void 0:I.getStream())||new MediaStream});Ee(this,"getUserStreams",(q,J=[])=>{J.length===0&&(J=mediaType_keys);const I={};for(const D of J){const a=this.getUserStream(q,D);I[D]=a}return I});Ee(this,"removeUserStreams",async(q,J=[])=>{J.length===0&&(J=mediaType_keys);for(const I of J)this.removeUserMediaStreamContext(q,I)});Ee(this,"clearUserStreams",()=>{{const q=De(this,cn).values();for(const J of q)J.stop();Ct(this,cn,new Map)}{const q=De(this,un).values();for(const J of q)J.stop();Ct(this,un,new Map)}});Ee(this,"setMediaTrackConstraints",async(q,J)=>{De(this,Ht).set(q,J);const I=await this.getLocalStream(q);if(!I)return;const D=I.getTracks();if(D.length!==0)for(const a of D){const O=a.getConstraints(),z={...De(this,Ht).get(q),...O,...J};await a.applyConstraints(z)}});Ee(this,"stopLocalStreams",async(q=[])=>{q.length===0&&(q=mediaType_keys);for(const J of q){const I=De(this,pn).get(J);I&&await this.stopStream(I),De(this,pn).delete(J)}});Ee(this,"addLocalStream",(q,J)=>{const I=De(this,pn).get(q);I&&this.stopStream(I),De(this,pn).set(q,J)});Ee(this,"initLocalStream",async q=>{switch(q){case"microphoneCamera_audio":{const J=De(this,en).get("audioinput"),I=De(this,Ht).get("microphoneCamera_audio"),D=await navigator.mediaDevices.getUserMedia({audio:{deviceId:J,...I},video:!1});this.addLocalStream("microphoneCamera_audio",D)}break;case"microphoneCamera_video":{const J=De(this,en).get("videoinput"),I=De(this,Ht).get("microphoneCamera_video"),D=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:J,...I}});this.addLocalStream("microphoneCamera_video",D)}break;case"microphoneCamera":{const J=De(this,en).get("audioinput"),I=De(this,en).get("videoinput"),D=De(this,Ht).get("microphoneCamera_audio"),a=De(this,Ht).get("microphoneCamera_video"),F=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:J,...D},video:{deviceId:I,...a}})).getTracks();for(const z of F){const{kind:K}=z;if(K==="audio"){const te=new MediaStream;te.addTrack(z),this.addLocalStream("microphoneCamera_audio",te)}if(K==="video"){const te=new MediaStream;te.addTrack(z),this.addLocalStream("microphoneCamera_video",te)}}}break;case"screenSharing_audio":{const J=De(this,Ht).get("screenSharing_audio"),D=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...J})).getTracks();for(const a of D){const{kind:O}=a;if(O==="audio"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_audio",F)}}}break;case"screenSharing_video":{const J=De(this,Ht).get(q),D=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...J})).getTracks();for(const a of D){const{kind:O}=a;if(O==="video"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_video",F)}}}break;case"screenSharing":{const J=De(this,Ht).get("screenSharing_audio"),I=De(this,Ht).get("screenSharing_video"),a=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...J,...I})).getTracks();for(const O of a){const{kind:F}=O;if(F==="audio"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_audio",z)}if(F==="video"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_video",z)}}}break}});Ee(this,"getLocalStream",async q=>{const J=De(this,pn).get(q),I=De(this,kn).get(q);let D=J;return J&&I&&(D=await I(J)),D});Ee(this,"getLocalStreams",async(q=[])=>{q.length===0&&(q=mediaType_keys);const J={};for(const I of q)J[I]=await this.getLocalStream(I);return J});at(this,Sn,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(q=>{const J=q.filter(I=>!["default","communications"].includes(I.deviceId));Ct(this,wn,J.sort((I,D)=>I.label.localeCompare(D.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",q)}),De(this,wn)));at(this,Fn,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await De(this,Sn).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),De(this,Sn).call(this)});Ee(this,"getMediaDeviceKind",q=>De(this,en).get(q));Ee(this,"changeAudiooutput",async()=>{try{const q=De(this,en).get("audiooutput");await this.audioContext.setSinkId(q)}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",q)}});Ee(this,"setDeviceKind",(q,J)=>{De(this,en).set(q,J)});Ee(this,"setAudioOutputDevice",q=>this.setDeviceKind("audiooutput",q));Ee(this,"getEnumerateDevices",async q=>(await De(this,Sn).call(this),De(this,wn).filter(I=>I.kind===q)));Ee(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Ee(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Ee(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));De(this,Fn).call(this),De(this,Ln).call(this),De(this,Un).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var J;((J=this.audioContext)==null?void 0:J.state)==="suspended"&&this.audioContext.resume()})}}wn=new WeakMap,en=new WeakMap,Ht=new WeakMap,cn=new WeakMap,un=new WeakMap,pn=new WeakMap,kn=new WeakMap,Un=new WeakMap,Ln=new WeakMap,Sn=new WeakMap,Fn=new WeakMap;class RoomUsers extends RoomMedias{constructor(q){super(q);Ee(this,"getMaxVolumeUser",()=>{const q=Array.from(this.userMap.values(),({id:I})=>I);if(q.length===0)return;let J=[];for(const I of q){const D=this.getUserAudioMediaStreamContext(I,"microphoneCamera_audio");if(!D)continue;const a=D.getVolume();J.push({id:I,volume:a})}return J=J.sort((I,D)=>I.volume-D.volume>0?-1:1),J[0]});Ee(this,"setVolume",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.setInputGain(I)});Ee(this,"setEnhanceGain",async(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.setEnhanceGain(I)});Ee(this,"setSpeaker",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.setOutputGain(I);const a=I===0;D==null||D.setMute(a)});Ee(this,"playBgs",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);return D==null?void 0:D.mixAudio(I,"bgs")});Ee(this,"setBgsGain",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.setBgsGain(I)});Ee(this,"stopBgs",(q,J)=>{const I=this.getUserAudioMediaStreamContext(q,J);I==null||I.mixAudioStop("bgs")});Ee(this,"playBgm",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);return D==null?void 0:D.mixAudio(I,"bgm")});Ee(this,"setBgmGain",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.setBgmGain(I)});Ee(this,"stopBgm",(q,J)=>{const I=this.getUserAudioMediaStreamContext(q,J);I==null||I.mixAudioStop("bgm")});Ee(this,"changBgsMix",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.changeMix("bgs",I)});Ee(this,"changBgmMix",(q,J,I)=>{const D=this.getUserAudioMediaStreamContext(q,J);D==null||D.changeMix("bgm",I)});Ee(this,"getVolume",(q,J)=>{const I=this.getUserAudioMediaStreamContext(q,J);return I==null?void 0:I.getVolume()});Ee(this,"clearUsers",()=>{this.userMap=new Map});Ee(this,"removeUsers",async q=>{for(const J of q)this.userMap.delete(J),await this.removeUserStreams(J)});Ee(this,"createUser",async q=>{const J=Date.now(),I={id:q,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:q===this.options.userId,isPublished:!1,joinTime:J,updateAt:J,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(q,I)});Ee(this,"getUser",async q=>(this.userMap.has(q)||await this.createUser(q),this.userMap.get(q)));Ee(this,"getUsers",async(q=[])=>{q.length===0&&(q=[...this.userMap.keys()]);const J=[];for(const I of q){const D=await this.getUser(I);J.push(D)}return J});Ee(this,"getAllUserTrackMids",async()=>{const q=await this.getUsers(),J=[];for(const I of q){const{tracks:D=[]}=I;for(const a of D)J.push(a.mid)}return J});Ee(this,"getUserTrackByTrackName",async q=>{const J=await this.getUsers(),I=[];for(const D of J){const{tracks:a=[]}=D;for(const O of a){const{trackName:F}=O;q.includes(F)&&I.push(O)}}return I});Ee(this,"getUserTrackFromMid",async q=>{const J=await this.getUsers();let I;for(const D of J){const{tracks:a=[]}=D;for(const O of a)if(O.mid===q){I=O;break}}return I});Ee(this,"checkUserInRoom",q=>this.userMap.has(q));Ee(this,"getUsersId",async()=>[...this.userMap.keys()]);Ee(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));Ee(this,"updateIsPublished",async(q,J=!1)=>{const I=await this.getUser(q);I.isPublished=J});Ee(this,"setUserUpdateStreams",async(q,J,I=!0)=>{const D=await this.getUser(q),a={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};a[J]=I,D.updateStreams=a});Ee(this,"updateUserChannels",async(q,J=[],I)=>{const D=await this.getUser(q);I&&(J=[...D.channels,...J]),D.channels=J});Ee(this,"updateUsertracks",async(q,J=[],I)=>{const D=await this.getUser(q);I&&(J=[...D.tracks,...J]),J=J.filter(({mid:F=""})=>F!==""),J=pt(J,["type"]),J=J.sort((F,z)=>F.type-z.type<0?-1:1);for(const F of J)F.userId=q,F.mediaType=mediaType_keys[F.type],F.enabled===void 0&&(F.enabled=!0);D.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const a=dt(D.tracks,["mediaType","enabled","mid","msid","trackName"]),O=dt(J,["mediaType","enabled","mid","msid","trackName"]);{const F="microphoneCamera_audio",z=O.find(ne=>ne.mediaType===F),K=a.find(ne=>ne.mediaType===F),te=JSON.stringify(z)!==JSON.stringify(K);D.updateStreams[F]=te}{const F="microphoneCamera_video",z=O.find(ne=>ne.mediaType===F),K=a.find(ne=>ne.mediaType===F),te=JSON.stringify(z)!==JSON.stringify(K);D.updateStreams[F]=te}{const F="screenSharing_audio",z=O.find(ne=>ne.mediaType===F),K=a.find(ne=>ne.mediaType===F),te=JSON.stringify(z)!==JSON.stringify(K);D.updateStreams[F]=te}{const F="screenSharing_video",z=O.find(ne=>ne.mediaType===F),K=a.find(ne=>ne.mediaType===F),te=JSON.stringify(z)!==JSON.stringify(K);D.updateStreams[F]=te}D.tracks=J});Ee(this,"updateUserCallAction",async(q,J=0)=>{const I=await this.getUser(q);I.callAction=J,I.callActionStr=J.toString(2).padStart(4,"0"),I.callActionMap=this.getCallActionMap(J)});Ee(this,"updateUserBehaviors",async(q,J=0)=>{const I=await this.getUser(q);I.banBehavior=J,I.banBehaviorStr=J.toString(2).padStart(4,"0"),I.banBehaviorMap=this.getBanBehaviorMap(J)});Ee(this,"updateUserNetwork",async(q,J={egress:5,ingress:5})=>{const I=await this.getUser(q);I.network=J});Ee(this,"updateUserPermissions",async(q,J)=>{if(J){const I=await this.getUser(q);I.permissions=J}});Ee(this,"updateUserBase",async q=>{const J=await this.getUser(q);J.isSelf=q===this.options.userId,J.updateAt=Date.now()});Ee(this,"updateUsers",async q=>{for(const J of q){const{id:I,tracks:D,callAction:a,permissions:O,isPublished:F}=J;await this.updateUserBase(I),await this.updateIsPublished(I,F),await this.updateUserPermissions(I,O),await this.updateUsertracks(I,D,!0),await this.updateUserCallAction(I,a),await this.updateUserNetwork(I)}});Ee(this,"emitNotifyUpdateUser",async q=>{const J=await this.getUsers([q]),[I]=this.usersFilter(J);this.cwsIns.emitNotify("onRoomUser",{code:200,data:I,desc:"user info is change."})});Ee(this,"emitNotifyUpdateUsers",async()=>{const q=await this.getUsers(),J=this.usersFilter(q);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:J,desc:"all users info is change."})})}}const t=(N,Z=4294967295,q=79764919)=>{const J=new Int32Array(256);let I,D,a,O=Z;for(I=0;I<256;I++){for(a=I<<24,D=8;D>0;--D)a=2147483648&a?a<<1^q:a<<1;J[I]=a}for(I=0;I<N.length;I++)O=O<<8^J[255&(O>>24^N[I])];return O},e=(N,Z=t)=>{const q=oe=>new Uint8Array(oe.length/2).map((se,fe)=>parseInt(oe.substring(2*fe,2*(fe+1)),16)),J=oe=>q(oe)[0],I=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach((oe,se)=>I.set(oe,se));const D=new Uint8Array(N.length);let a,O,F,z=!1,K=0,te=42,ne=N.length>13&&N.substring(0,9)==="dynEncode",ee=0;ne&&(ee=11,O=J(N.substring(9,ee)),O<=1&&(ee+=2,te=J(N.substring(11,ee))),O===1&&(ee+=8,F=(oe=>new DataView(q(oe).buffer).getInt32(0,!0))(N.substring(13,ee))));const re=256-te;for(let oe=ee;oe<N.length;oe++)if(a=N.charCodeAt(oe),a!==61||z){if(a===92&&oe<N.length-5&&ne){const se=N.charCodeAt(oe+1);se!==117&&se!==85||(a=parseInt(N.substring(oe+2,oe+6),16),oe+=5)}if(a>255){const se=I.get(a);se&&(a=se+127)}z&&(z=!1,a-=64),D[K++]=a<te&&a>0?a+re:a-te}else z=!0;const ce=D.subarray(0,K);if(ne&&O===1){const oe=Z(ce);if(oe!==F){const se="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",se+`
|
|
14
|
-
`,"Expected: "+
|
|
15
|
-
`,"Visit https://github.com/eshaz/simple-yenc for more information"),Error(
|
|
13
|
+
*/var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function($){const z=requireBase64Js(),D=requireIeee754(),j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=k,$.SlowBuffer=ce,$.INSPECT_MAX_BYTES=50;const O=2147483647;$.kMaxLength=O,k.TYPED_ARRAY_SUPPORT=I(),!k.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 I(){try{const re=new Uint8Array(1),Z={foo:function(){return 42}};return Object.setPrototypeOf(Z,Uint8Array.prototype),Object.setPrototypeOf(re,Z),re.foo()===42}catch{return!1}}Object.defineProperty(k.prototype,"parent",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.buffer}}),Object.defineProperty(k.prototype,"offset",{enumerable:!0,get:function(){if(k.isBuffer(this))return this.byteOffset}});function o(re){if(re>O)throw new RangeError('The value "'+re+'" is invalid for option "size"');const Z=new Uint8Array(re);return Object.setPrototypeOf(Z,k.prototype),Z}function k(re,Z,K){if(typeof re=="number"){if(typeof Z=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(re)}return N(re,Z,K)}k.poolSize=8192;function N(re,Z,K){if(typeof re=="string")return Y(re,Z);if(ArrayBuffer.isView(re))return te(re);if(re==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof re);if(jt(re,ArrayBuffer)||re&&jt(re.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(jt(re,SharedArrayBuffer)||re&&jt(re.buffer,SharedArrayBuffer)))return ie(re,Z,K);if(typeof re=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ue=re.valueOf&&re.valueOf();if(ue!=null&&ue!==re)return k.from(ue,Z,K);const ge=ne(re);if(ge)return ge;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof re[Symbol.toPrimitive]=="function")return k.from(re[Symbol.toPrimitive]("string"),Z,K);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof re)}k.from=function(re,Z,K){return N(re,Z,K)},Object.setPrototypeOf(k.prototype,Uint8Array.prototype),Object.setPrototypeOf(k,Uint8Array);function F(re){if(typeof re!="number")throw new TypeError('"size" argument must be of type number');if(re<0)throw new RangeError('The value "'+re+'" is invalid for option "size"')}function J(re,Z,K){return F(re),re<=0?o(re):Z!==void 0?typeof K=="string"?o(re).fill(Z,K):o(re).fill(Z):o(re)}k.alloc=function(re,Z,K){return J(re,Z,K)};function X(re){return F(re),o(re<0?0:oe(re)|0)}k.allocUnsafe=function(re){return X(re)},k.allocUnsafeSlow=function(re){return X(re)};function Y(re,Z){if((typeof Z!="string"||Z==="")&&(Z="utf8"),!k.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);const K=we(re,Z)|0;let ue=o(K);const ge=ue.write(re,Z);return ge!==K&&(ue=ue.slice(0,ge)),ue}function Q(re){const Z=re.length<0?0:oe(re.length)|0,K=o(Z);for(let ue=0;ue<Z;ue+=1)K[ue]=re[ue]&255;return K}function te(re){if(jt(re,Uint8Array)){const Z=new Uint8Array(re);return ie(Z.buffer,Z.byteOffset,Z.byteLength)}return Q(re)}function ie(re,Z,K){if(Z<0||re.byteLength<Z)throw new RangeError('"offset" is outside of buffer bounds');if(re.byteLength<Z+(K||0))throw new RangeError('"length" is outside of buffer bounds');let ue;return Z===void 0&&K===void 0?ue=new Uint8Array(re):K===void 0?ue=new Uint8Array(re,Z):ue=new Uint8Array(re,Z,K),Object.setPrototypeOf(ue,k.prototype),ue}function ne(re){if(k.isBuffer(re)){const Z=oe(re.length)|0,K=o(Z);return K.length===0||re.copy(K,0,0,Z),K}if(re.length!==void 0)return typeof re.length!="number"||Vt(re.length)?o(0):Q(re);if(re.type==="Buffer"&&Array.isArray(re.data))return Q(re.data)}function oe(re){if(re>=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return re|0}function ce(re){return+re!=re&&(re=0),k.alloc(+re)}k.isBuffer=function(Z){return Z!=null&&Z._isBuffer===!0&&Z!==k.prototype},k.compare=function(Z,K){if(jt(Z,Uint8Array)&&(Z=k.from(Z,Z.offset,Z.byteLength)),jt(K,Uint8Array)&&(K=k.from(K,K.offset,K.byteLength)),!k.isBuffer(Z)||!k.isBuffer(K))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Z===K)return 0;let ue=Z.length,ge=K.length;for(let Ae=0,Me=Math.min(ue,ge);Ae<Me;++Ae)if(Z[Ae]!==K[Ae]){ue=Z[Ae],ge=K[Ae];break}return ue<ge?-1:ge<ue?1:0},k.isEncoding=function(Z){switch(String(Z).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}},k.concat=function(Z,K){if(!Array.isArray(Z))throw new TypeError('"list" argument must be an Array of Buffers');if(Z.length===0)return k.alloc(0);let ue;if(K===void 0)for(K=0,ue=0;ue<Z.length;++ue)K+=Z[ue].length;const ge=k.allocUnsafe(K);let Ae=0;for(ue=0;ue<Z.length;++ue){let Me=Z[ue];if(jt(Me,Uint8Array))Ae+Me.length>ge.length?(k.isBuffer(Me)||(Me=k.from(Me)),Me.copy(ge,Ae)):Uint8Array.prototype.set.call(ge,Me,Ae);else if(k.isBuffer(Me))Me.copy(ge,Ae);else throw new TypeError('"list" argument must be an Array of Buffers');Ae+=Me.length}return ge};function we(re,Z){if(k.isBuffer(re))return re.length;if(ArrayBuffer.isView(re)||jt(re,ArrayBuffer))return re.byteLength;if(typeof re!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof re);const K=re.length,ue=arguments.length>2&&arguments[2]===!0;if(!ue&&K===0)return 0;let ge=!1;for(;;)switch(Z){case"ascii":case"latin1":case"binary":return K;case"utf8":case"utf-8":return Jt(re).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K*2;case"hex":return K>>>1;case"base64":return Yt(re).length;default:if(ge)return ue?-1:Jt(re).length;Z=(""+Z).toLowerCase(),ge=!0}}k.byteLength=we;function se(re,Z,K){let ue=!1;if((Z===void 0||Z<0)&&(Z=0),Z>this.length||((K===void 0||K>this.length)&&(K=this.length),K<=0)||(K>>>=0,Z>>>=0,K<=Z))return"";for(re||(re="utf8");;)switch(re){case"hex":return Lt(this,Z,K);case"utf8":case"utf-8":return Fe(this,Z,K);case"ascii":return St(this,Z,K);case"latin1":case"binary":return It(this,Z,K);case"base64":return je(this,Z,K);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nt(this,Z,K);default:if(ue)throw new TypeError("Unknown encoding: "+re);re=(re+"").toLowerCase(),ue=!0}}k.prototype._isBuffer=!0;function ye(re,Z,K){const ue=re[Z];re[Z]=re[K],re[K]=ue}k.prototype.swap16=function(){const Z=this.length;if(Z%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let K=0;K<Z;K+=2)ye(this,K,K+1);return this},k.prototype.swap32=function(){const Z=this.length;if(Z%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let K=0;K<Z;K+=4)ye(this,K,K+3),ye(this,K+1,K+2);return this},k.prototype.swap64=function(){const Z=this.length;if(Z%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let K=0;K<Z;K+=8)ye(this,K,K+7),ye(this,K+1,K+6),ye(this,K+2,K+5),ye(this,K+3,K+4);return this},k.prototype.toString=function(){const Z=this.length;return Z===0?"":arguments.length===0?Fe(this,0,Z):se.apply(this,arguments)},k.prototype.toLocaleString=k.prototype.toString,k.prototype.equals=function(Z){if(!k.isBuffer(Z))throw new TypeError("Argument must be a Buffer");return this===Z?!0:k.compare(this,Z)===0},k.prototype.inspect=function(){let Z="";const K=$.INSPECT_MAX_BYTES;return Z=this.toString("hex",0,K).replace(/(.{2})/g,"$1 ").trim(),this.length>K&&(Z+=" ... "),"<Buffer "+Z+">"},j&&(k.prototype[j]=k.prototype.inspect),k.prototype.compare=function(Z,K,ue,ge,Ae){if(jt(Z,Uint8Array)&&(Z=k.from(Z,Z.offset,Z.byteLength)),!k.isBuffer(Z))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Z);if(K===void 0&&(K=0),ue===void 0&&(ue=Z?Z.length:0),ge===void 0&&(ge=0),Ae===void 0&&(Ae=this.length),K<0||ue>Z.length||ge<0||Ae>this.length)throw new RangeError("out of range index");if(ge>=Ae&&K>=ue)return 0;if(ge>=Ae)return-1;if(K>=ue)return 1;if(K>>>=0,ue>>>=0,ge>>>=0,Ae>>>=0,this===Z)return 0;let Me=Ae-ge,ot=ue-K;const _t=Math.min(Me,ot),ut=this.slice(ge,Ae),Tt=Z.slice(K,ue);for(let wt=0;wt<_t;++wt)if(ut[wt]!==Tt[wt]){Me=ut[wt],ot=Tt[wt];break}return Me<ot?-1:ot<Me?1:0};function fe(re,Z,K,ue,ge){if(re.length===0)return-1;if(typeof K=="string"?(ue=K,K=0):K>2147483647?K=2147483647:K<-2147483648&&(K=-2147483648),K=+K,Vt(K)&&(K=ge?0:re.length-1),K<0&&(K=re.length+K),K>=re.length){if(ge)return-1;K=re.length-1}else if(K<0)if(ge)K=0;else return-1;if(typeof Z=="string"&&(Z=k.from(Z,ue)),k.isBuffer(Z))return Z.length===0?-1:pe(re,Z,K,ue,ge);if(typeof Z=="number")return Z=Z&255,typeof Uint8Array.prototype.indexOf=="function"?ge?Uint8Array.prototype.indexOf.call(re,Z,K):Uint8Array.prototype.lastIndexOf.call(re,Z,K):pe(re,[Z],K,ue,ge);throw new TypeError("val must be string, number or Buffer")}function pe(re,Z,K,ue,ge){let Ae=1,Me=re.length,ot=Z.length;if(ue!==void 0&&(ue=String(ue).toLowerCase(),ue==="ucs2"||ue==="ucs-2"||ue==="utf16le"||ue==="utf-16le")){if(re.length<2||Z.length<2)return-1;Ae=2,Me/=2,ot/=2,K/=2}function _t(Tt,wt){return Ae===1?Tt[wt]:Tt.readUInt16BE(wt*Ae)}let ut;if(ge){let Tt=-1;for(ut=K;ut<Me;ut++)if(_t(re,ut)===_t(Z,Tt===-1?0:ut-Tt)){if(Tt===-1&&(Tt=ut),ut-Tt+1===ot)return Tt*Ae}else Tt!==-1&&(ut-=ut-Tt),Tt=-1}else for(K+ot>Me&&(K=Me-ot),ut=K;ut>=0;ut--){let Tt=!0;for(let wt=0;wt<ot;wt++)if(_t(re,ut+wt)!==_t(Z,wt)){Tt=!1;break}if(Tt)return ut}return-1}k.prototype.includes=function(Z,K,ue){return this.indexOf(Z,K,ue)!==-1},k.prototype.indexOf=function(Z,K,ue){return fe(this,Z,K,ue,!0)},k.prototype.lastIndexOf=function(Z,K,ue){return fe(this,Z,K,ue,!1)};function ve(re,Z,K,ue){K=Number(K)||0;const ge=re.length-K;ue?(ue=Number(ue),ue>ge&&(ue=ge)):ue=ge;const Ae=Z.length;ue>Ae/2&&(ue=Ae/2);let Me;for(Me=0;Me<ue;++Me){const ot=parseInt(Z.substr(Me*2,2),16);if(Vt(ot))return Me;re[K+Me]=ot}return Me}function Te(re,Z,K,ue){return Xt(Jt(Z,re.length-K),re,K,ue)}function me(re,Z,K,ue){return Xt(Wt(Z),re,K,ue)}function _e(re,Z,K,ue){return Xt(Yt(Z),re,K,ue)}function De(re,Z,K,ue){return Xt(cn(Z,re.length-K),re,K,ue)}k.prototype.write=function(Z,K,ue,ge){if(K===void 0)ge="utf8",ue=this.length,K=0;else if(ue===void 0&&typeof K=="string")ge=K,ue=this.length,K=0;else if(isFinite(K))K=K>>>0,isFinite(ue)?(ue=ue>>>0,ge===void 0&&(ge="utf8")):(ge=ue,ue=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const Ae=this.length-K;if((ue===void 0||ue>Ae)&&(ue=Ae),Z.length>0&&(ue<0||K<0)||K>this.length)throw new RangeError("Attempt to write outside buffer bounds");ge||(ge="utf8");let Me=!1;for(;;)switch(ge){case"hex":return ve(this,Z,K,ue);case"utf8":case"utf-8":return Te(this,Z,K,ue);case"ascii":case"latin1":case"binary":return me(this,Z,K,ue);case"base64":return _e(this,Z,K,ue);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return De(this,Z,K,ue);default:if(Me)throw new TypeError("Unknown encoding: "+ge);ge=(""+ge).toLowerCase(),Me=!0}},k.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function je(re,Z,K){return Z===0&&K===re.length?z.fromByteArray(re):z.fromByteArray(re.slice(Z,K))}function Fe(re,Z,K){K=Math.min(re.length,K);const ue=[];let ge=Z;for(;ge<K;){const Ae=re[ge];let Me=null,ot=Ae>239?4:Ae>223?3:Ae>191?2:1;if(ge+ot<=K){let _t,ut,Tt,wt;switch(ot){case 1:Ae<128&&(Me=Ae);break;case 2:_t=re[ge+1],(_t&192)===128&&(wt=(Ae&31)<<6|_t&63,wt>127&&(Me=wt));break;case 3:_t=re[ge+1],ut=re[ge+2],(_t&192)===128&&(ut&192)===128&&(wt=(Ae&15)<<12|(_t&63)<<6|ut&63,wt>2047&&(wt<55296||wt>57343)&&(Me=wt));break;case 4:_t=re[ge+1],ut=re[ge+2],Tt=re[ge+3],(_t&192)===128&&(ut&192)===128&&(Tt&192)===128&&(wt=(Ae&15)<<18|(_t&63)<<12|(ut&63)<<6|Tt&63,wt>65535&&wt<1114112&&(Me=wt))}}Me===null?(Me=65533,ot=1):Me>65535&&(Me-=65536,ue.push(Me>>>10&1023|55296),Me=56320|Me&1023),ue.push(Me),ge+=ot}return gt(ue)}const qe=4096;function gt(re){const Z=re.length;if(Z<=qe)return String.fromCharCode.apply(String,re);let K="",ue=0;for(;ue<Z;)K+=String.fromCharCode.apply(String,re.slice(ue,ue+=qe));return K}function St(re,Z,K){let ue="";K=Math.min(re.length,K);for(let ge=Z;ge<K;++ge)ue+=String.fromCharCode(re[ge]&127);return ue}function It(re,Z,K){let ue="";K=Math.min(re.length,K);for(let ge=Z;ge<K;++ge)ue+=String.fromCharCode(re[ge]);return ue}function Lt(re,Z,K){const ue=re.length;(!Z||Z<0)&&(Z=0),(!K||K<0||K>ue)&&(K=ue);let ge="";for(let Ae=Z;Ae<K;++Ae)ge+=yn[re[Ae]];return ge}function Nt(re,Z,K){const ue=re.slice(Z,K);let ge="";for(let Ae=0;Ae<ue.length-1;Ae+=2)ge+=String.fromCharCode(ue[Ae]+ue[Ae+1]*256);return ge}k.prototype.slice=function(Z,K){const ue=this.length;Z=~~Z,K=K===void 0?ue:~~K,Z<0?(Z+=ue,Z<0&&(Z=0)):Z>ue&&(Z=ue),K<0?(K+=ue,K<0&&(K=0)):K>ue&&(K=ue),K<Z&&(K=Z);const ge=this.subarray(Z,K);return Object.setPrototypeOf(ge,k.prototype),ge};function yt(re,Z,K){if(re%1!==0||re<0)throw new RangeError("offset is not uint");if(re+Z>K)throw new RangeError("Trying to access beyond buffer length")}k.prototype.readUintLE=k.prototype.readUIntLE=function(Z,K,ue){Z=Z>>>0,K=K>>>0,ue||yt(Z,K,this.length);let ge=this[Z],Ae=1,Me=0;for(;++Me<K&&(Ae*=256);)ge+=this[Z+Me]*Ae;return ge},k.prototype.readUintBE=k.prototype.readUIntBE=function(Z,K,ue){Z=Z>>>0,K=K>>>0,ue||yt(Z,K,this.length);let ge=this[Z+--K],Ae=1;for(;K>0&&(Ae*=256);)ge+=this[Z+--K]*Ae;return ge},k.prototype.readUint8=k.prototype.readUInt8=function(Z,K){return Z=Z>>>0,K||yt(Z,1,this.length),this[Z]},k.prototype.readUint16LE=k.prototype.readUInt16LE=function(Z,K){return Z=Z>>>0,K||yt(Z,2,this.length),this[Z]|this[Z+1]<<8},k.prototype.readUint16BE=k.prototype.readUInt16BE=function(Z,K){return Z=Z>>>0,K||yt(Z,2,this.length),this[Z]<<8|this[Z+1]},k.prototype.readUint32LE=k.prototype.readUInt32LE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),(this[Z]|this[Z+1]<<8|this[Z+2]<<16)+this[Z+3]*16777216},k.prototype.readUint32BE=k.prototype.readUInt32BE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),this[Z]*16777216+(this[Z+1]<<16|this[Z+2]<<8|this[Z+3])},k.prototype.readBigUInt64LE=en(function(Z){Z=Z>>>0,vt(Z,"offset");const K=this[Z],ue=this[Z+7];(K===void 0||ue===void 0)&&Rt(Z,this.length-8);const ge=K+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24,Ae=this[++Z]+this[++Z]*2**8+this[++Z]*2**16+ue*2**24;return BigInt(ge)+(BigInt(Ae)<<BigInt(32))}),k.prototype.readBigUInt64BE=en(function(Z){Z=Z>>>0,vt(Z,"offset");const K=this[Z],ue=this[Z+7];(K===void 0||ue===void 0)&&Rt(Z,this.length-8);const ge=K*2**24+this[++Z]*2**16+this[++Z]*2**8+this[++Z],Ae=this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ue;return(BigInt(ge)<<BigInt(32))+BigInt(Ae)}),k.prototype.readIntLE=function(Z,K,ue){Z=Z>>>0,K=K>>>0,ue||yt(Z,K,this.length);let ge=this[Z],Ae=1,Me=0;for(;++Me<K&&(Ae*=256);)ge+=this[Z+Me]*Ae;return Ae*=128,ge>=Ae&&(ge-=Math.pow(2,8*K)),ge},k.prototype.readIntBE=function(Z,K,ue){Z=Z>>>0,K=K>>>0,ue||yt(Z,K,this.length);let ge=K,Ae=1,Me=this[Z+--ge];for(;ge>0&&(Ae*=256);)Me+=this[Z+--ge]*Ae;return Ae*=128,Me>=Ae&&(Me-=Math.pow(2,8*K)),Me},k.prototype.readInt8=function(Z,K){return Z=Z>>>0,K||yt(Z,1,this.length),this[Z]&128?(255-this[Z]+1)*-1:this[Z]},k.prototype.readInt16LE=function(Z,K){Z=Z>>>0,K||yt(Z,2,this.length);const ue=this[Z]|this[Z+1]<<8;return ue&32768?ue|4294901760:ue},k.prototype.readInt16BE=function(Z,K){Z=Z>>>0,K||yt(Z,2,this.length);const ue=this[Z+1]|this[Z]<<8;return ue&32768?ue|4294901760:ue},k.prototype.readInt32LE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),this[Z]|this[Z+1]<<8|this[Z+2]<<16|this[Z+3]<<24},k.prototype.readInt32BE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),this[Z]<<24|this[Z+1]<<16|this[Z+2]<<8|this[Z+3]},k.prototype.readBigInt64LE=en(function(Z){Z=Z>>>0,vt(Z,"offset");const K=this[Z],ue=this[Z+7];(K===void 0||ue===void 0)&&Rt(Z,this.length-8);const ge=this[Z+4]+this[Z+5]*2**8+this[Z+6]*2**16+(ue<<24);return(BigInt(ge)<<BigInt(32))+BigInt(K+this[++Z]*2**8+this[++Z]*2**16+this[++Z]*2**24)}),k.prototype.readBigInt64BE=en(function(Z){Z=Z>>>0,vt(Z,"offset");const K=this[Z],ue=this[Z+7];(K===void 0||ue===void 0)&&Rt(Z,this.length-8);const ge=(K<<24)+this[++Z]*2**16+this[++Z]*2**8+this[++Z];return(BigInt(ge)<<BigInt(32))+BigInt(this[++Z]*2**24+this[++Z]*2**16+this[++Z]*2**8+ue)}),k.prototype.readFloatLE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),D.read(this,Z,!0,23,4)},k.prototype.readFloatBE=function(Z,K){return Z=Z>>>0,K||yt(Z,4,this.length),D.read(this,Z,!1,23,4)},k.prototype.readDoubleLE=function(Z,K){return Z=Z>>>0,K||yt(Z,8,this.length),D.read(this,Z,!0,52,8)},k.prototype.readDoubleBE=function(Z,K){return Z=Z>>>0,K||yt(Z,8,this.length),D.read(this,Z,!1,52,8)};function tt(re,Z,K,ue,ge,Ae){if(!k.isBuffer(re))throw new TypeError('"buffer" argument must be a Buffer instance');if(Z>ge||Z<Ae)throw new RangeError('"value" argument is out of bounds');if(K+ue>re.length)throw new RangeError("Index out of range")}k.prototype.writeUintLE=k.prototype.writeUIntLE=function(Z,K,ue,ge){if(Z=+Z,K=K>>>0,ue=ue>>>0,!ge){const ot=Math.pow(2,8*ue)-1;tt(this,Z,K,ue,ot,0)}let Ae=1,Me=0;for(this[K]=Z&255;++Me<ue&&(Ae*=256);)this[K+Me]=Z/Ae&255;return K+ue},k.prototype.writeUintBE=k.prototype.writeUIntBE=function(Z,K,ue,ge){if(Z=+Z,K=K>>>0,ue=ue>>>0,!ge){const ot=Math.pow(2,8*ue)-1;tt(this,Z,K,ue,ot,0)}let Ae=ue-1,Me=1;for(this[K+Ae]=Z&255;--Ae>=0&&(Me*=256);)this[K+Ae]=Z/Me&255;return K+ue},k.prototype.writeUint8=k.prototype.writeUInt8=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,1,255,0),this[K]=Z&255,K+1},k.prototype.writeUint16LE=k.prototype.writeUInt16LE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,2,65535,0),this[K]=Z&255,this[K+1]=Z>>>8,K+2},k.prototype.writeUint16BE=k.prototype.writeUInt16BE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,2,65535,0),this[K]=Z>>>8,this[K+1]=Z&255,K+2},k.prototype.writeUint32LE=k.prototype.writeUInt32LE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,4,4294967295,0),this[K+3]=Z>>>24,this[K+2]=Z>>>16,this[K+1]=Z>>>8,this[K]=Z&255,K+4},k.prototype.writeUint32BE=k.prototype.writeUInt32BE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,4,4294967295,0),this[K]=Z>>>24,this[K+1]=Z>>>16,this[K+2]=Z>>>8,this[K+3]=Z&255,K+4};function zt(re,Z,K,ue,ge){it(Z,ue,ge,re,K,7);let Ae=Number(Z&BigInt(4294967295));re[K++]=Ae,Ae=Ae>>8,re[K++]=Ae,Ae=Ae>>8,re[K++]=Ae,Ae=Ae>>8,re[K++]=Ae;let Me=Number(Z>>BigInt(32)&BigInt(4294967295));return re[K++]=Me,Me=Me>>8,re[K++]=Me,Me=Me>>8,re[K++]=Me,Me=Me>>8,re[K++]=Me,K}function Ot(re,Z,K,ue,ge){it(Z,ue,ge,re,K,7);let Ae=Number(Z&BigInt(4294967295));re[K+7]=Ae,Ae=Ae>>8,re[K+6]=Ae,Ae=Ae>>8,re[K+5]=Ae,Ae=Ae>>8,re[K+4]=Ae;let Me=Number(Z>>BigInt(32)&BigInt(4294967295));return re[K+3]=Me,Me=Me>>8,re[K+2]=Me,Me=Me>>8,re[K+1]=Me,Me=Me>>8,re[K]=Me,K+8}k.prototype.writeBigUInt64LE=en(function(Z,K=0){return zt(this,Z,K,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeBigUInt64BE=en(function(Z,K=0){return Ot(this,Z,K,BigInt(0),BigInt("0xffffffffffffffff"))}),k.prototype.writeIntLE=function(Z,K,ue,ge){if(Z=+Z,K=K>>>0,!ge){const _t=Math.pow(2,8*ue-1);tt(this,Z,K,ue,_t-1,-_t)}let Ae=0,Me=1,ot=0;for(this[K]=Z&255;++Ae<ue&&(Me*=256);)Z<0&&ot===0&&this[K+Ae-1]!==0&&(ot=1),this[K+Ae]=(Z/Me>>0)-ot&255;return K+ue},k.prototype.writeIntBE=function(Z,K,ue,ge){if(Z=+Z,K=K>>>0,!ge){const _t=Math.pow(2,8*ue-1);tt(this,Z,K,ue,_t-1,-_t)}let Ae=ue-1,Me=1,ot=0;for(this[K+Ae]=Z&255;--Ae>=0&&(Me*=256);)Z<0&&ot===0&&this[K+Ae+1]!==0&&(ot=1),this[K+Ae]=(Z/Me>>0)-ot&255;return K+ue},k.prototype.writeInt8=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,1,127,-128),Z<0&&(Z=255+Z+1),this[K]=Z&255,K+1},k.prototype.writeInt16LE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,2,32767,-32768),this[K]=Z&255,this[K+1]=Z>>>8,K+2},k.prototype.writeInt16BE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,2,32767,-32768),this[K]=Z>>>8,this[K+1]=Z&255,K+2},k.prototype.writeInt32LE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,4,2147483647,-2147483648),this[K]=Z&255,this[K+1]=Z>>>8,this[K+2]=Z>>>16,this[K+3]=Z>>>24,K+4},k.prototype.writeInt32BE=function(Z,K,ue){return Z=+Z,K=K>>>0,ue||tt(this,Z,K,4,2147483647,-2147483648),Z<0&&(Z=4294967295+Z+1),this[K]=Z>>>24,this[K+1]=Z>>>16,this[K+2]=Z>>>8,this[K+3]=Z&255,K+4},k.prototype.writeBigInt64LE=en(function(Z,K=0){return zt(this,Z,K,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),k.prototype.writeBigInt64BE=en(function(Z,K=0){return Ot(this,Z,K,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ne(re,Z,K,ue,ge,Ae){if(K+ue>re.length)throw new RangeError("Index out of range");if(K<0)throw new RangeError("Index out of range")}function nt(re,Z,K,ue,ge){return Z=+Z,K=K>>>0,ge||Ne(re,Z,K,4),D.write(re,Z,K,ue,23,4),K+4}k.prototype.writeFloatLE=function(Z,K,ue){return nt(this,Z,K,!0,ue)},k.prototype.writeFloatBE=function(Z,K,ue){return nt(this,Z,K,!1,ue)};function Ht(re,Z,K,ue,ge){return Z=+Z,K=K>>>0,ge||Ne(re,Z,K,8),D.write(re,Z,K,ue,52,8),K+8}k.prototype.writeDoubleLE=function(Z,K,ue){return Ht(this,Z,K,!0,ue)},k.prototype.writeDoubleBE=function(Z,K,ue){return Ht(this,Z,K,!1,ue)},k.prototype.copy=function(Z,K,ue,ge){if(!k.isBuffer(Z))throw new TypeError("argument should be a Buffer");if(ue||(ue=0),!ge&&ge!==0&&(ge=this.length),K>=Z.length&&(K=Z.length),K||(K=0),ge>0&&ge<ue&&(ge=ue),ge===ue||Z.length===0||this.length===0)return 0;if(K<0)throw new RangeError("targetStart out of bounds");if(ue<0||ue>=this.length)throw new RangeError("Index out of range");if(ge<0)throw new RangeError("sourceEnd out of bounds");ge>this.length&&(ge=this.length),Z.length-K<ge-ue&&(ge=Z.length-K+ue);const Ae=ge-ue;return this===Z&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(K,ue,ge):Uint8Array.prototype.set.call(Z,this.subarray(ue,ge),K),Ae},k.prototype.fill=function(Z,K,ue,ge){if(typeof Z=="string"){if(typeof K=="string"?(ge=K,K=0,ue=this.length):typeof ue=="string"&&(ge=ue,ue=this.length),ge!==void 0&&typeof ge!="string")throw new TypeError("encoding must be a string");if(typeof ge=="string"&&!k.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);if(Z.length===1){const Me=Z.charCodeAt(0);(ge==="utf8"&&Me<128||ge==="latin1")&&(Z=Me)}}else typeof Z=="number"?Z=Z&255:typeof Z=="boolean"&&(Z=Number(Z));if(K<0||this.length<K||this.length<ue)throw new RangeError("Out of range index");if(ue<=K)return this;K=K>>>0,ue=ue===void 0?this.length:ue>>>0,Z||(Z=0);let Ae;if(typeof Z=="number")for(Ae=K;Ae<ue;++Ae)this[Ae]=Z;else{const Me=k.isBuffer(Z)?Z:k.from(Z,ge),ot=Me.length;if(ot===0)throw new TypeError('The value "'+Z+'" is invalid for argument "value"');for(Ae=0;Ae<ue-K;++Ae)this[Ae+K]=Me[Ae%ot]}return this};const At={};function et(re,Z,K){At[re]=class extends K{constructor(){super(),Object.defineProperty(this,"message",{value:Z.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${re}]`,this.stack,delete this.name}get code(){return re}set code(ge){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ge,writable:!0})}toString(){return`${this.name} [${re}]: ${this.message}`}}}et("ERR_BUFFER_OUT_OF_BOUNDS",function(re){return re?`${re} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),et("ERR_INVALID_ARG_TYPE",function(re,Z){return`The "${re}" argument must be of type number. Received type ${typeof Z}`},TypeError),et("ERR_OUT_OF_RANGE",function(re,Z,K){let ue=`The value of "${re}" is out of range.`,ge=K;return Number.isInteger(K)&&Math.abs(K)>2**32?ge=Qe(String(K)):typeof K=="bigint"&&(ge=String(K),(K>BigInt(2)**BigInt(32)||K<-(BigInt(2)**BigInt(32)))&&(ge=Qe(ge)),ge+="n"),ue+=` It must be ${Z}. Received ${ge}`,ue},RangeError);function Qe(re){let Z="",K=re.length;const ue=re[0]==="-"?1:0;for(;K>=ue+4;K-=3)Z=`_${re.slice(K-3,K)}${Z}`;return`${re.slice(0,K)}${Z}`}function rt(re,Z,K){vt(Z,"offset"),(re[Z]===void 0||re[Z+K]===void 0)&&Rt(Z,re.length-(K+1))}function it(re,Z,K,ue,ge,Ae){if(re>K||re<Z){const Me=typeof Z=="bigint"?"n":"";let ot;throw Z===0||Z===BigInt(0)?ot=`>= 0${Me} and < 2${Me} ** ${(Ae+1)*8}${Me}`:ot=`>= -(2${Me} ** ${(Ae+1)*8-1}${Me}) and < 2 ** ${(Ae+1)*8-1}${Me}`,new At.ERR_OUT_OF_RANGE("value",ot,re)}rt(ue,ge,Ae)}function vt(re,Z){if(typeof re!="number")throw new At.ERR_INVALID_ARG_TYPE(Z,"number",re)}function Rt(re,Z,K){throw Math.floor(re)!==re?(vt(re,K),new At.ERR_OUT_OF_RANGE("offset","an integer",re)):Z<0?new At.ERR_BUFFER_OUT_OF_BOUNDS:new At.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Z}`,re)}const Mt=/[^+/0-9A-Za-z-_]/g;function qt(re){if(re=re.split("=")[0],re=re.trim().replace(Mt,""),re.length<2)return"";for(;re.length%4!==0;)re=re+"=";return re}function Jt(re,Z){Z=Z||1/0;let K;const ue=re.length;let ge=null;const Ae=[];for(let Me=0;Me<ue;++Me){if(K=re.charCodeAt(Me),K>55295&&K<57344){if(!ge){if(K>56319){(Z-=3)>-1&&Ae.push(239,191,189);continue}else if(Me+1===ue){(Z-=3)>-1&&Ae.push(239,191,189);continue}ge=K;continue}if(K<56320){(Z-=3)>-1&&Ae.push(239,191,189),ge=K;continue}K=(ge-55296<<10|K-56320)+65536}else ge&&(Z-=3)>-1&&Ae.push(239,191,189);if(ge=null,K<128){if((Z-=1)<0)break;Ae.push(K)}else if(K<2048){if((Z-=2)<0)break;Ae.push(K>>6|192,K&63|128)}else if(K<65536){if((Z-=3)<0)break;Ae.push(K>>12|224,K>>6&63|128,K&63|128)}else if(K<1114112){if((Z-=4)<0)break;Ae.push(K>>18|240,K>>12&63|128,K>>6&63|128,K&63|128)}else throw new Error("Invalid code point")}return Ae}function Wt(re){const Z=[];for(let K=0;K<re.length;++K)Z.push(re.charCodeAt(K)&255);return Z}function cn(re,Z){let K,ue,ge;const Ae=[];for(let Me=0;Me<re.length&&!((Z-=2)<0);++Me)K=re.charCodeAt(Me),ue=K>>8,ge=K%256,Ae.push(ge),Ae.push(ue);return Ae}function Yt(re){return z.toByteArray(qt(re))}function Xt(re,Z,K,ue){let ge;for(ge=0;ge<ue&&!(ge+K>=Z.length||ge>=re.length);++ge)Z[ge+K]=re[ge];return ge}function jt(re,Z){return re instanceof Z||re!=null&&re.constructor!=null&&re.constructor.name!=null&&re.constructor.name===Z.name}function Vt(re){return re!==re}const yn=function(){const re="0123456789abcdef",Z=new Array(256);for(let K=0;K<16;++K){const ue=K*16;for(let ge=0;ge<16;++ge)Z[ue+ge]=re[K]+re[ge]}return Z}();function en(re){return typeof BigInt>"u"?Zt:re}function Zt(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var $=toolsEbml&&toolsEbml.__assign||function(){return $=Object.assign||function(O){for(var I,o=1,k=arguments.length;o<k;o++){I=arguments[o];for(var N in I)Object.prototype.hasOwnProperty.call(I,N)&&(O[N]=I[N])}return O},$.apply(this,arguments)},z=toolsEbml&&toolsEbml.__spreadArray||function(O,I,o){if(o||arguments.length===2)for(var k=0,N=I.length,F;k<N;k++)(F||!(k in I))&&(F||(F=Array.prototype.slice.call(I,0,k)),F[k]=I[k]);return O.concat(F||Array.prototype.slice.call(I))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var D=requireTools(),j=function(){function O(){}return O.readVint=function(I,o){o===void 0&&(o=0);var k=8-Math.floor(Math.log2(I[o]));if(k>8){var N=O.readHexString(I,o,o+k);throw new Error("Unrepresentable length: ".concat(k," ").concat(N))}if(o+k>I.length)return null;for(var F=I[o]&(1<<8-k)-1,J=1;J<k;J+=1){if(J===7&&F>=Math.pow(2,8)&&I[o+7]>0)return{length:k,value:-1};F*=Math.pow(2,8),F+=I[o+J]}return{length:k,value:F}},O.writeVint=function(I){if(I<0||I>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(I));var o=1;for(o=1;o<=8&&!(I<Math.pow(2,7*o)-1);o+=1);for(var k=D.Buffer.alloc(o),N=I,F=1;F<=o;F+=1){var J=N&255;k[o-F]=J,N-=J,N/=Math.pow(2,8)}return k[0]|=1<<8-o,k},O.concatenate=function(I,o){return!I&&!o?D.Buffer.from([]):!I||I.byteLength===0?o:!o||o.byteLength===0?I:D.Buffer.from(z(z([],I,!0),o,!0))},O.readHexString=function(I,o,k){return o===void 0&&(o=0),k===void 0&&(k=I.byteLength),Array.from(I.slice(o,k)).map(function(N){return Number(N).toString(16)}).reduce(function(N,F){return"".concat(N).concat(F.padStart(2,"0"))},"")},O.readUtf8=function(I){try{return D.Buffer.from(I).toString("utf8")}catch{return null}},O.readUnsigned=function(I){var o=new DataView(I.buffer,I.byteOffset,I.byteLength);switch(I.byteLength){case 1:return o.getUint8(0);case 2:return o.getUint16(0);case 4:return o.getUint32(0)}return I.byteLength<=6?I.reduce(function(k,N){return k*256+N},0):O.readHexString(I,0,I.byteLength)},O.readSigned=function(I){var o=new DataView(I.buffer,I.byteOffset,I.byteLength);switch(I.byteLength){case 1:return o.getInt8(0);case 2:return o.getInt16(0);case 4:return o.getInt32(0);default:return NaN}},O.readFloat=function(I){var o=new DataView(I.buffer,I.byteOffset,I.byteLength);switch(I.byteLength){case 4:return o.getFloat32(0);case 8:return o.getFloat64(0);default:return NaN}},O.readDate=function(I){var o=new DataView(I.buffer,I.byteOffset,I.byteLength);switch(I.byteLength){case 1:return new Date(o.getUint8(0));case 2:return new Date(o.getUint16(0));case 4:return new Date(o.getUint32(0));case 8:return new Date(Number.parseInt(O.readHexString(I),16));default:return new Date(0)}},O.readDataFromTag=function(I,o){var k=I.type,N=I.name,F=I.track,J=I.discardable||!1,X=I.keyframe||!1,Y=null,Q;switch(k){case"u":Q=O.readUnsigned(o);break;case"f":Q=O.readFloat(o);break;case"i":Q=O.readSigned(o);break;case"s":Q=String.fromCharCode.apply(String,o);break;case"8":Q=O.readUtf8(o);break;case"d":Q=O.readDate(o);break}if(N==="SimpleBlock"||N==="Block"){var te=0,ie=O.readVint(o,te),ne=ie.length,oe=ie.value;te+=ne,F=oe,Q=O.readSigned(o.subarray(te,te+2)),te+=2,N==="SimpleBlock"&&(X=!!(o[ne+2]&128),J=!!(o[ne+2]&1)),te+=1,Y=o.subarray(te)}return $($({},I),{data:o,discardable:J,keyframe:X,payload:Y,track:F,value:Q})},O}();return toolsEbml.default=j,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function($,z,D){z=z||0;for(var j=1;j<=8&&!($[z]>=Math.pow(2,8-j));j++);if(j>8)throw new Error("Unrepresentable length: "+j+" "+$.toString("hex",z,z+j));if(z+j>$.length)return null;var O,I=$[z]&(1<<8-j)-1;for(O=1;O<j;O++){if(O===7&&I>=Math.pow(2,45)&&$[z+7]>0)return{length:j,value:-1};I*=Math.pow(2,8),I+=$[z+O]}return D&&(I-=Math.pow(2,j*7-1)-1),{length:j,value:I}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var $=requireVint();function z(D){this.buffer=D,this.offset=0}return z.prototype.nextInt16BE=function(){var D=this.buffer.readInt16BE(this.offset);return this.offset+=2,D},z.prototype.nextUInt8=function(){var D=this.buffer.readUInt8(this.offset);return this.offset+=1,D},z.prototype.nextUIntV=function(){var D=$(this.buffer,this.offset);return this.offset+=D.length,D.value},z.prototype.nextIntV=function(){var D=$(this.buffer,this.offset,!0);return this.offset+=D.length,D.value},z.prototype.nextBuffer=function(D){var j=D?this.buffer.slice(this.offset,this.offset+D):this.buffer.slice(this.offset);return this.offset+=D||this.length,j},Object.defineProperty(z.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=z,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var $=requireBufferReader(),z=1,D=3,j=2;ebmlBlock=function(I){var o={},k=new $(I);o.trackNumber=k.nextUIntV(),o.timecode=k.nextInt16BE();var N=k.nextUInt8();o.invisible=!!(N&8),o.keyframe=!!(N&128),o.discardable=!!(N&1);var F=(N&6)>>1;return o.frames=O(k,F),o};function O(I,o){if(!o)return[I.nextBuffer()];var k,N,F=[],J=I.nextUInt8()+1;if(o===j){if(I.length%J!==0)throw new Error("Fixed-Size Lacing Error");for(N=I.length/J,k=0;k<J;k++)F.push(I.nextBuffer(N));return F}var X=[];if(o===z)for(k=0;k<J-1;k++){var Y;N=0;do Y=I.nextUInt8(),N+=Y;while(Y===255);X.push(N)}else if(o===D)for(N=I.nextUIntV(),X.push(N),k=1;k<J-1;k++)N+=I.nextIntV(),X.push(N);for(k=0;k<J-1;k++)F.push(I.nextBuffer(X[k]));return F.push(I.nextBuffer()),F}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function($){Object.defineProperty($,"__esModule",{value:!0}),$.convertEBMLDateToJSDate=$.createFloatBuffer=$.createIntBuffer=$.createUIntBuffer=$.encodeValueToBuffer=$.concat=$.putRefinedMetaData=$.extractElement=$.removeElement=$.makeMetadataSeekable=$.createRIFFChunk=$.VP8BitStreamToRiffWebPBuffer=$.WebPBlockFilter=$.encodeTag=$.readBlock=$.ebmlBlock=$.writeVint=$.readVint=$.Buffer=void 0;var z=requireInt64Buffer(),D=requireEBMLEncoder(),j=requireBuffer(),O=requireToolsEbml(),I=requireEbmlBlock();$.Buffer=j.Buffer,$.readVint=O.default.readVint,$.writeVint=O.default.writeVint,$.ebmlBlock=I;function o(me){return(0,$.ebmlBlock)(new $.Buffer(me))}$.readBlock=o;function k(me,_e,De){return De===void 0&&(De=!1),se([me,De?new $.Buffer("01ffffffffffffff","hex"):(0,$.writeVint)(_e.length),_e])}$.encodeTag=k;function N(me){return me.reduce(function(_e,De){if(De.type!=="b"||De.name!=="SimpleBlock")return _e;var je=(0,$.ebmlBlock)(De.data),Fe=je.frames.some(function(qe){var gt=qe.slice(3,6).toString("hex");return gt==="9d012a"});return Fe?_e.concat(De):_e},[])}$.WebPBlockFilter=N;function F(me){var _e=J("VP8 ",me),De=se([new $.Buffer("WEBP","ascii"),_e]);return J("RIFF",De)}$.VP8BitStreamToRiffWebPBuffer=F;function J(me,_e){var De=new $.Buffer(4);return De.writeUInt32LE(_e.byteLength,0),se([new $.Buffer(me.substr(0,4),"ascii"),De,_e,new $.Buffer(_e.byteLength%2===0?0:1)])}$.createRIFFChunk=J;function X(me,_e,De){var je=Q("EBML",me),Fe=ie(je),qe=Fe+12,gt=me[me.length-1].dataEnd-qe,St=Q("Info",me);Y("Duration",St),St.splice(1,0,{name:"Duration",type:"f",data:ve(_e,8)});for(var It=ie(St),Lt=Q("Tracks",me),Nt=ie(Lt),yt=47,tt=[],zt=5+De.length*15,Ot=[],Ne=-1,nt=10,Ht=function(it){var vt=yt,Rt=vt+It,Mt=Rt+Nt,qt=Mt+zt,Jt=qt-gt;if(tt=[],tt.push({name:"SeekHead",type:"m",isEnd:!1}),tt.push({name:"Seek",type:"m",isEnd:!1}),tt.push({name:"SeekID",type:"b",data:new $.Buffer([21,73,169,102])}),tt.push({name:"SeekPosition",type:"u",data:fe(vt)}),tt.push({name:"Seek",type:"m",isEnd:!0}),tt.push({name:"Seek",type:"m",isEnd:!1}),tt.push({name:"SeekID",type:"b",data:new $.Buffer([22,84,174,107])}),tt.push({name:"SeekPosition",type:"u",data:fe(Rt)}),tt.push({name:"Seek",type:"m",isEnd:!0}),tt.push({name:"Seek",type:"m",isEnd:!1}),tt.push({name:"SeekID",type:"b",data:new $.Buffer([28,83,187,107])}),tt.push({name:"SeekPosition",type:"u",data:fe(Mt)}),tt.push({name:"Seek",type:"m",isEnd:!0}),tt.push({name:"SeekHead",type:"m",isEnd:!0}),yt=ie(tt),Ot=[],Ot.push({name:"Cues",type:"m",isEnd:!1}),De.forEach(function(Wt){var cn=Wt.CueTrack,Yt=Wt.CueClusterPosition,Xt=Wt.CueTime;Ot.push({name:"CuePoint",type:"m",isEnd:!1}),Ot.push({name:"CueTime",type:"u",data:fe(Xt)}),Ot.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ot.push({name:"CueTrack",type:"u",data:fe(cn)}),Yt-=qe,Yt+=Jt,Ot.push({name:"CueClusterPosition",type:"u",data:fe(Yt)}),Ot.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ot.push({name:"CuePoint",type:"m",isEnd:!0})}),Ot.push({name:"Cues",type:"m",isEnd:!0}),zt=ie(Ot),Ne!==Jt){if(Ne=Jt,it===nt-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},At=0;At<nt;At++){var et=Ht(At);if(et==="break")break}var Qe=[].concat.apply([],[je,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},tt,St,Lt,Ot]),rt=new D.default().encode(Qe);return rt}$.makeMetadataSeekable=X;function Y(me,_e){for(var De=-1,je=0;je<_e.length;je++){var Fe=_e[je];if(Fe.name===me)if(Fe.type==="m")if(!Fe.isEnd)De=je;else{if(De==-1)throw new Error("Detected ".concat(me," closing element before finding the start"));_e.splice(De,je-De+1);return}else{_e.splice(je,1);return}}}$.removeElement=Y;function Q(me,_e){for(var De=[],je=-1,Fe=0;Fe<_e.length;Fe++){var qe=_e[Fe];if(qe.name===me)if(qe.type==="m")if(!qe.isEnd)je=Fe;else{if(je==-1)throw new Error("Detected ".concat(me," closing element before finding the start"));De=_e.slice(je,Fe+1);break}else{De.push(_e[Fe]);break}}return De}$.extractElement=Q;function te(me,_e){Array.isArray(_e.cueInfos)&&!Array.isArray(_e.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),_e.cues=_e.cueInfos);for(var De=[],je=[],Fe=0;Fe<me.length;Fe++){var qe=me[Fe];if(qe.type==="m"&&qe.name==="Segment"){if(De=me.slice(0,Fe),je=me.slice(Fe),qe.unknownSize){je.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(je[je.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var gt=je[je.length-1].dataEnd,St=De[De.length-1].dataEnd,It=new D.default().encode(De).byteLength,Lt=It-St,Nt=gt-je[0].tagStart;je[0].tagStart-St,je[0].tagStart;var yt=new $.Buffer([24,83,128,103]),tt=new $.Buffer("01ffffffffffffff","hex"),zt=yt.byteLength+tt.byteLength,Ot=Nt,Ne;for(Ne=1;Ne<20;Ne++){var nt=St+zt+Ot,Ht=nt-gt,At=Lt+Ht,et=ne(je,At,_e),Qe=new D.default().encode(et).byteLength;if(Qe===Ot)return new D.default().encode([].concat(De,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],et));Ot=Qe}throw new Error("unable to refine metadata, stable size could not be found in "+Ne+" iterations!")}$.putRefinedMetaData=te;function ie(me){var _e=new D.default;return me.reduce(function(De,je){return De.concat(_e.encode([je]))},[]).reduce(function(De,je){return De+je.byteLength},0)}function ne(me,_e,De){var je=De.duration,Fe=De.clusterPtrs,qe=De.cues,gt=me.slice(0);if(typeof je=="number"){var St=!1;gt.forEach(function(Lt){Lt.type==="f"&&Lt.name==="Duration"&&(St=!0,Lt.data=ve(je,8))}),St||we(gt,"Info",[{name:"Duration",type:"f",data:ve(je,8)}])}Array.isArray(qe)&&we(gt,"Cues",ce(qe,_e));var It=[];return Array.isArray(Fe)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),It=oe(Fe,_e)),we(gt,"SeekHead",It,!0),gt}function oe(me,_e){var De=[];return me.forEach(function(je){De.push({name:"Seek",type:"m",isEnd:!1}),De.push({name:"SeekID",type:"b",data:new $.Buffer([31,67,182,117])}),De.push({name:"SeekPosition",type:"u",data:fe(je+_e)}),De.push({name:"Seek",type:"m",isEnd:!0})}),De}function ce(me,_e){var De=[];return me.forEach(function(je){var Fe=je.CueTrack,qe=je.CueClusterPosition,gt=je.CueTime;De.push({name:"CuePoint",type:"m",isEnd:!1}),De.push({name:"CueTime",type:"u",data:fe(gt)}),De.push({name:"CueTrackPositions",type:"m",isEnd:!1}),De.push({name:"CueTrack",type:"u",data:fe(Fe)}),De.push({name:"CueClusterPosition",type:"u",data:fe(qe+_e)}),De.push({name:"CueTrackPositions",type:"m",isEnd:!0}),De.push({name:"CuePoint",type:"m",isEnd:!0})}),De}function we(me,_e,De,je){je===void 0&&(je=!1);for(var Fe=-1,qe=0;qe<me.length;qe++){var gt=me[qe];if(gt.type==="m"&>.name===_e&>.isEnd===!1){Fe=qe;break}}Fe>=0?Array.prototype.splice.apply(me,[Fe+1,0].concat(De)):je?[].concat([{name:_e,type:"m",isEnd:!1}],De,[{name:_e,type:"m",isEnd:!0}]).reverse().forEach(function(St){me.unshift(St)}):(me.push({name:_e,type:"m",isEnd:!1}),De.forEach(function(St){me.push(St)}),me.push({name:_e,type:"m",isEnd:!0}))}function se(me){return $.Buffer.concat(me)}$.concat=se;function ye(me){var _e=new $.Buffer(0);if(me.type==="m")return me;switch(me.type){case"u":_e=fe(me.value);break;case"i":_e=pe(me.value);break;case"f":_e=ve(me.value);break;case"s":_e=new $.Buffer(me.value,"ascii");break;case"8":_e=new $.Buffer(me.value,"utf8");break;case"b":_e=me.value;break;case"d":_e=new z.Int64BE(me.value.getTime().toString()).toBuffer();break}return Object.assign({},me,{data:_e})}$.encodeValueToBuffer=ye;function fe(me){for(var _e=1;me>=Math.pow(2,8*_e);_e++);if(_e>=7)return console.warn("7bit or more bigger uint not supported."),new z.Uint64BE(me).toBuffer();var De=new $.Buffer(_e);return De.writeUIntBE(me,0,_e),De}$.createUIntBuffer=fe;function pe(me){for(var _e=1;me>=Math.pow(2,8*_e);_e++);if(_e>=7)return console.warn("7bit or more bigger uint not supported."),new z.Int64BE(me).toBuffer();var De=new $.Buffer(_e);return De.writeIntBE(me,0,_e),De}$.createIntBuffer=pe;function ve(me,_e){if(_e===void 0&&(_e=8),_e===8){var De=new $.Buffer(8);return De.writeDoubleBE(me,0),De}else if(_e===4){var De=new $.Buffer(4);return De.writeFloatBE(me,0),De}else throw new Error("float type bits must 4bytes or 8bytes")}$.createFloatBuffer=ve;function Te(me){return me instanceof Date?me:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(me)/1e3/1e3)}$.convertEBMLDateToJSDate=Te}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var $=requireInt64Buffer(),z=requireTools(),D=requireTools(),j=requireEbmlID(),O;(function(o){o[o.STATE_TAG=1]="STATE_TAG",o[o.STATE_SIZE=2]="STATE_SIZE",o[o.STATE_CONTENT=3]="STATE_CONTENT"})(O||(O={}));var I=function(){function o(){this._buffer=new z.Buffer(0),this._tag_stack=[],this._state=O.STATE_TAG,this._cursor=0,this._total=0,this._schema=j.byEbmlID,this._result=[]}return o.prototype.decode=function(k){this.readChunk(k);var N=this._result;return this._result=[],N},o.prototype.readChunk=function(k){for(this._buffer=D.concat([this._buffer,new z.Buffer(k)]);this._cursor<this._buffer.length&&!(this._state===O.STATE_TAG&&!this.readTag()||this._state===O.STATE_SIZE&&!this.readSize()||this._state===O.STATE_CONTENT&&!this.readContent()););},o.prototype.getSchemaInfo=function(k){return this._schema[k]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},o.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var k=(0,z.readVint)(this._buffer,this._cursor);if(k==null)return!1;var N=this._buffer.slice(this._cursor,this._cursor+k.length),F=N.reduce(function(Y,Q,te,ie){return Y+Q*Math.pow(16,2*(ie.length-1-te))},0),J=this.getSchemaInfo(F),X={EBML_ID:F.toString(16),schema:J,type:J.type,name:J.name,level:J.level,tagStart:this._total,tagEnd:this._total+k.length,sizeStart:this._total+k.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(X),this._cursor+=k.length,this._total+=k.length,this._state=O.STATE_SIZE,!0},o.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var k=(0,z.readVint)(this._buffer,this._cursor);if(k==null)return!1;var N=this._tag_stack[this._tag_stack.length-1];return N.sizeEnd=N.sizeStart+k.length,N.dataStart=N.sizeEnd,N.dataSize=k.value,k.value===-1?(N.dataEnd=-1,N.type==="m"&&(N.unknownSize=!0)):N.dataEnd=N.sizeEnd+k.value,this._cursor+=k.length,this._total+=k.length,this._state=O.STATE_CONTENT,!0},o.prototype.readContent=function(){var k=this._tag_stack[this._tag_stack.length-1];if(k.type==="m"){if(k.isEnd=!1,this._result.push(k),this._state=O.STATE_TAG,k.dataSize===0){var N=Object.assign({},k,{isEnd:!0});this._result.push(N),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+k.dataSize)return!1;var F=this._buffer.slice(this._cursor,this._cursor+k.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+k.dataSize),k.data=F,k.type){case"u":k.value=F.readUIntBE(0,F.length);break;case"i":k.value=F.readIntBE(0,F.length);break;case"f":k.value=k.dataSize===4?F.readFloatBE(0):k.dataSize===8?F.readDoubleBE(0):(console.warn("cannot read ".concat(k.dataSize," octets float. failback to 0")),0);break;case"s":k.value=F.toString("ascii");break;case"8":k.value=F.toString("utf8");break;case"b":k.value=F;break;case"d":k.value=(0,z.convertEBMLDateToJSDate)(new $.Int64BE(F).toNumber());break}if(k.value===null)throw new Error("unknown tag type:"+k.type);for(this._result.push(k),this._total+=k.dataSize,this._state=O.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var J=this._tag_stack[this._tag_stack.length-1];if(J.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<J.dataEnd)break;if(J.type!=="m")throw new Error("parent element is not master element");var N=Object.assign({},J,{isEnd:!0});this._result.push(N),this._tag_stack.pop()}return!0},o}();return EBMLDecoder.default=I,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var $=typeof Reflect=="object"?Reflect:null,z=$&&typeof $.apply=="function"?$.apply:function(ye,fe,pe){return Function.prototype.apply.call(ye,fe,pe)},D;$&&typeof $.ownKeys=="function"?D=$.ownKeys:Object.getOwnPropertySymbols?D=function(ye){return Object.getOwnPropertyNames(ye).concat(Object.getOwnPropertySymbols(ye))}:D=function(ye){return Object.getOwnPropertyNames(ye)};function j(se){console&&console.warn&&console.warn(se)}var O=Number.isNaN||function(ye){return ye!==ye};function I(){I.init.call(this)}events.exports=I,events.exports.once=oe,I.EventEmitter=I,I.prototype._events=void 0,I.prototype._eventsCount=0,I.prototype._maxListeners=void 0;var o=10;function k(se){if(typeof se!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof se)}Object.defineProperty(I,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(se){if(typeof se!="number"||se<0||O(se))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+se+".");o=se}}),I.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},I.prototype.setMaxListeners=function(ye){if(typeof ye!="number"||ye<0||O(ye))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ye+".");return this._maxListeners=ye,this};function N(se){return se._maxListeners===void 0?I.defaultMaxListeners:se._maxListeners}I.prototype.getMaxListeners=function(){return N(this)},I.prototype.emit=function(ye){for(var fe=[],pe=1;pe<arguments.length;pe++)fe.push(arguments[pe]);var ve=ye==="error",Te=this._events;if(Te!==void 0)ve=ve&&Te.error===void 0;else if(!ve)return!1;if(ve){var me;if(fe.length>0&&(me=fe[0]),me instanceof Error)throw me;var _e=new Error("Unhandled error."+(me?" ("+me.message+")":""));throw _e.context=me,_e}var De=Te[ye];if(De===void 0)return!1;if(typeof De=="function")z(De,this,fe);else for(var je=De.length,Fe=te(De,je),pe=0;pe<je;++pe)z(Fe[pe],this,fe);return!0};function F(se,ye,fe,pe){var ve,Te,me;if(k(fe),Te=se._events,Te===void 0?(Te=se._events=Object.create(null),se._eventsCount=0):(Te.newListener!==void 0&&(se.emit("newListener",ye,fe.listener?fe.listener:fe),Te=se._events),me=Te[ye]),me===void 0)me=Te[ye]=fe,++se._eventsCount;else if(typeof me=="function"?me=Te[ye]=pe?[fe,me]:[me,fe]:pe?me.unshift(fe):me.push(fe),ve=N(se),ve>0&&me.length>ve&&!me.warned){me.warned=!0;var _e=new Error("Possible EventEmitter memory leak detected. "+me.length+" "+String(ye)+" listeners added. Use emitter.setMaxListeners() to increase limit");_e.name="MaxListenersExceededWarning",_e.emitter=se,_e.type=ye,_e.count=me.length,j(_e)}return se}I.prototype.addListener=function(ye,fe){return F(this,ye,fe,!1)},I.prototype.on=I.prototype.addListener,I.prototype.prependListener=function(ye,fe){return F(this,ye,fe,!0)};function J(){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 X(se,ye,fe){var pe={fired:!1,wrapFn:void 0,target:se,type:ye,listener:fe},ve=J.bind(pe);return ve.listener=fe,pe.wrapFn=ve,ve}I.prototype.once=function(ye,fe){return k(fe),this.on(ye,X(this,ye,fe)),this},I.prototype.prependOnceListener=function(ye,fe){return k(fe),this.prependListener(ye,X(this,ye,fe)),this},I.prototype.removeListener=function(ye,fe){var pe,ve,Te,me,_e;if(k(fe),ve=this._events,ve===void 0)return this;if(pe=ve[ye],pe===void 0)return this;if(pe===fe||pe.listener===fe)--this._eventsCount===0?this._events=Object.create(null):(delete ve[ye],ve.removeListener&&this.emit("removeListener",ye,pe.listener||fe));else if(typeof pe!="function"){for(Te=-1,me=pe.length-1;me>=0;me--)if(pe[me]===fe||pe[me].listener===fe){_e=pe[me].listener,Te=me;break}if(Te<0)return this;Te===0?pe.shift():ie(pe,Te),pe.length===1&&(ve[ye]=pe[0]),ve.removeListener!==void 0&&this.emit("removeListener",ye,_e||fe)}return this},I.prototype.off=I.prototype.removeListener,I.prototype.removeAllListeners=function(ye){var fe,pe,ve;if(pe=this._events,pe===void 0)return this;if(pe.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):pe[ye]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete pe[ye]),this;if(arguments.length===0){var Te=Object.keys(pe),me;for(ve=0;ve<Te.length;++ve)me=Te[ve],me!=="removeListener"&&this.removeAllListeners(me);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(fe=pe[ye],typeof fe=="function")this.removeListener(ye,fe);else if(fe!==void 0)for(ve=fe.length-1;ve>=0;ve--)this.removeListener(ye,fe[ve]);return this};function Y(se,ye,fe){var pe=se._events;if(pe===void 0)return[];var ve=pe[ye];return ve===void 0?[]:typeof ve=="function"?fe?[ve.listener||ve]:[ve]:fe?ne(ve):te(ve,ve.length)}I.prototype.listeners=function(ye){return Y(this,ye,!0)},I.prototype.rawListeners=function(ye){return Y(this,ye,!1)},I.listenerCount=function(se,ye){return typeof se.listenerCount=="function"?se.listenerCount(ye):Q.call(se,ye)},I.prototype.listenerCount=Q;function Q(se){var ye=this._events;if(ye!==void 0){var fe=ye[se];if(typeof fe=="function")return 1;if(fe!==void 0)return fe.length}return 0}I.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function te(se,ye){for(var fe=new Array(ye),pe=0;pe<ye;++pe)fe[pe]=se[pe];return fe}function ie(se,ye){for(;ye+1<se.length;ye++)se[ye]=se[ye+1];se.pop()}function ne(se){for(var ye=new Array(se.length),fe=0;fe<ye.length;++fe)ye[fe]=se[fe].listener||se[fe];return ye}function oe(se,ye){return new Promise(function(fe,pe){function ve(me){se.removeListener(ye,Te),pe(me)}function Te(){typeof se.removeListener=="function"&&se.removeListener("error",ve),fe([].slice.call(arguments))}we(se,ye,Te,{once:!0}),ye!=="error"&&ce(se,ve,{once:!0})})}function ce(se,ye,fe){typeof se.on=="function"&&we(se,"error",ye,fe)}function we(se,ye,fe,pe){if(typeof se.on=="function")pe.once?se.once(ye,fe):se.on(ye,fe);else if(typeof se.addEventListener=="function")se.addEventListener(ye,function ve(Te){pe.once&&se.removeEventListener(ye,ve),fe(Te)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof se)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var $=EBMLReader&&EBMLReader.__extends||function(){var O=function(I,o){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,N){k.__proto__=N}||function(k,N){for(var F in N)Object.prototype.hasOwnProperty.call(N,F)&&(k[F]=N[F])},O(I,o)};return function(I,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");O(I,o);function k(){this.constructor=I}I.prototype=o===null?Object.create(o):(k.prototype=o.prototype,new k)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var z=requireEvents(),D=requireTools(),j=function(O){$(I,O);function I(){var o=O.call(this)||this;return o.logGroup="",o.hasLoggingStarted=!1,o.metadataloaded=!1,o.chunks=[],o.stack=[],o.segmentOffset=0,o.last2SimpleBlockVideoTrackTimecode=[0,0],o.last2SimpleBlockAudioTrackTimecode=[0,0],o.lastClusterTimecode=0,o.lastClusterPosition=0,o.timecodeScale=1e6,o.metadataSize=0,o.metadatas=[],o.cues=[],o.firstVideoBlockRead=!1,o.firstAudioBlockRead=!1,o.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},o.trackTypes=[],o.trackDefaultDuration=[],o.trackCodecDelay=[],o.trackInfo={type:"nothing"},o.ended=!1,o.logging=!1,o.use_duration_every_simpleblock=!1,o.use_webp=!1,o.use_segment_info=!0,o.drop_default_duration=!0,o}return I.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()},I.prototype.emit_segment_info=function(){var o=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var F=this.lastClusterTimecode,J=this.duration,X=this.timecodeScale;this.emit("cluster",{timecode:F,data:o}),this.emit("duration",{timecodeScale:X,duration:J})}else{this.metadataloaded=!0,this.metadatas=o;var k=this.trackTypes.indexOf(1),N=this.trackTypes.indexOf(2);if(this.trackInfo=k>=0&&N>=0?{type:"both",trackNumber:k}:k>=0?{type:"video",trackNumber:k}:N>=0?{type:"audio",trackNumber:N}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:o,metadataSize:this.metadataSize})}},I.prototype.read=function(o){var k=this,N=!1;if(!this.ended){if(o.type==="m")if(o.isEnd)this.stack.pop();else{var F=this.stack[this.stack.length-1];if(F!=null&&F.level>=o.level){this.stack.pop(),this.logging&&console.groupEnd(),F.dataEnd=o.dataEnd,F.dataSize=o.dataEnd-F.dataStart,F.unknownSize=!1;var J=Object.assign({},F,{name:F.name,type:F.type,isEnd:!0});this.chunks.push(J)}this.stack.push(o)}if(o.type==="m"&&o.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=o.dataStart,this.emit("segment_offset",this.segmentOffset);else if(o.type==="b"&&o.name==="SimpleBlock"){var X=D.ebmlBlock(o.data),Y=X.timecode,Q=X.trackNumber,te=X.frames;if(this.trackTypes[Q]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ie=this.lastClusterTimecode+Y;this.cues.push({CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:ie}),this.emit("cue_info",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:ie})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],Y]}else if(this.trackTypes[Q]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ie=this.lastClusterTimecode+Y;this.cues.push({CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:ie}),this.emit("cue_info",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:ie})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],Y]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&te.forEach(function(ne){var oe=ne.slice(3,6).toString("hex");if(oe==="9d012a"){var ce=D.VP8BitStreamToRiffWebPBuffer(ne),we=new Blob([ce],{type:"image/webp"}),se=k.duration;k.emit("webp",{currentTime:se,webp:we})}})}else o.type==="m"&&o.name==="Cluster"&&o.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",o.tagStart),this.lastClusterPosition=o.tagStart):o.type==="u"&&o.name==="Timecode"?this.lastClusterTimecode=o.value:o.type==="u"&&o.name==="TimecodeScale"?this.timecodeScale=o.value:o.type==="m"&&o.name==="TrackEntry"?o.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}:o.type==="u"&&o.name==="TrackType"?this.currentTrack.TrackType=o.value:o.type==="u"&&o.name==="TrackNumber"?this.currentTrack.TrackNumber=o.value:o.type==="u"&&o.name==="CodecDelay"?this.currentTrack.CodecDelay=o.value:o.type==="u"&&o.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),N=!0):this.currentTrack.DefaultDuration=o.value:o.name==="unknown"&&console.warn(o);!this.metadataloaded&&o.dataEnd>0&&(this.metadataSize=o.dataEnd),N||this.chunks.push(o),this.logging&&this.put(o)}},Object.defineProperty(I.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var o=0,k=0,N=0,F=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof F=="number")o=F;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){o=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var J=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof J=="number"&&(k=J),N=this.last2SimpleBlockAudioTrackTimecode[1]}else{o=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var J=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof J=="number"&&(k=J),N=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){o=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var J=this.trackCodecDelay[this.trackInfo.trackNumber];typeof J=="number"&&(k=J),N=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){o=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var J=this.trackCodecDelay[this.trackInfo.trackNumber];typeof J=="number"&&(k=J),N=this.last2SimpleBlockAudioTrackTimecode[1]}var X=(this.lastClusterTimecode+N)*this.timecodeScale+o-k,Y=X/this.timecodeScale;return Math.floor(Y)},enumerable:!1,configurable:!0}),I.prototype.addListener=function(o,k){return O.prototype.addListener.call(this,o,k)},I.prototype.put=function(o){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),o.type==="m"?o.isEnd?console.groupEnd():console.group(o.name+":"+o.tagStart):o.type==="b"?console.log(o.name,o.type):console.log(o.name,o.tagStart,o.type,o.value)},I}(z.EventEmitter);return EBMLReader.default=j,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function($){var z=ebml&&ebml.__createBinding||(Object.create?function(k,N,F,J){J===void 0&&(J=F),Object.defineProperty(k,J,{enumerable:!0,get:function(){return N[F]}})}:function(k,N,F,J){J===void 0&&(J=F),k[J]=N[F]}),D=ebml&&ebml.__exportStar||function(k,N){for(var F in k)F!=="default"&&!Object.prototype.hasOwnProperty.call(N,F)&&z(N,k,F)};Object.defineProperty($,"__esModule",{value:!0}),$.tools=$.Reader=$.Encoder=$.Decoder=void 0,D(requireEBML(),$);var j=requireEBMLDecoder();$.Decoder=j.default;var O=requireEBMLEncoder();$.Encoder=O.default;var I=requireEBMLReader();$.Reader=I.default;var o=requireTools();$.tools=o}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var $=lib&&lib.__awaiter||function(O,I,o,k){function N(F){return F instanceof o?F:new o(function(J){J(F)})}return new(o||(o=Promise))(function(F,J){function X(te){try{Q(k.next(te))}catch(ie){J(ie)}}function Y(te){try{Q(k.throw(te))}catch(ie){J(ie)}}function Q(te){te.done?F(te.value):N(te.value).then(X,Y)}Q((k=k.apply(O,I||[])).next())})},z=lib&&lib.__generator||function(O,I){var o={label:0,sent:function(){if(F[0]&1)throw F[1];return F[1]},trys:[],ops:[]},k,N,F,J;return J={next:X(0),throw:X(1),return:X(2)},typeof Symbol=="function"&&(J[Symbol.iterator]=function(){return this}),J;function X(Q){return function(te){return Y([Q,te])}}function Y(Q){if(k)throw new TypeError("Generator is already executing.");for(;o;)try{if(k=1,N&&(F=Q[0]&2?N.return:Q[0]?N.throw||((F=N.return)&&F.call(N),0):N.next)&&!(F=F.call(N,Q[1])).done)return F;switch(N=0,F&&(Q=[Q[0]&2,F.value]),Q[0]){case 0:case 1:F=Q;break;case 4:return o.label++,{value:Q[1],done:!1};case 5:o.label++,N=Q[1],Q=[0];continue;case 7:Q=o.ops.pop(),o.trys.pop();continue;default:if(F=o.trys,!(F=F.length>0&&F[F.length-1])&&(Q[0]===6||Q[0]===2)){o=0;continue}if(Q[0]===3&&(!F||Q[1]>F[0]&&Q[1]<F[3])){o.label=Q[1];break}if(Q[0]===6&&o.label<F[1]){o.label=F[1],F=Q;break}if(F&&o.label<F[2]){o.label=F[2],o.ops.push(Q);break}F[2]&&o.ops.pop(),o.trys.pop();continue}Q=I.call(O,o)}catch(te){Q=[6,te],N=0}finally{k=F=0}if(Q[0]&5)throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var D=requireEbml();function j(O){return $(this,void 0,void 0,function(){var I,o,k,N,F,J,X,Y,Q,te,ie,ne;return z(this,function(oe){switch(oe.label){case 0:if(!O)throw Error("call to fixWebmDuration requires a blob");I=new D.Decoder,o=new D.Reader,k=O.stream(),N=k.getReader(),oe.label=1;case 1:return[4,N.read()];case 2:return F=oe.sent(),J=F.done,X=F.value,J?(o.stop(),[3,3]):(Y=I.decode(X),Y=Y==null?void 0:Y.filter(function(ce){return ce.type!=="unknown"}),Y.forEach(function(ce){o.read(ce)}),X=null,[3,1]);case 3:return Q=D.tools.makeMetadataSeekable(o.metadatas,o.duration,o.cues),te=new Blob([Q],{type:O.type}),ie=O.slice(o.metadataSize),ne=new Blob([te,ie],{type:O.type}),[2,ne]}})})}return lib.default=j,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){Xe(this,Kt);Xe(this,dn,!1);Xe(this,un,!1);Xe(this,Tn,0);Xe(this,On,0);Xe(this,rn,0);Xe(this,an,0);Xe(this,hn,0);Se(this,"onchange",z=>{});Se(this,"onDurationChange",z=>{});Se(this,"start",async(z="")=>{z||(z=`video_Record_${E(Date.now())}`);let D=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(j=>{const O=j.getTracks();for(const o of O)o.onended=()=>this.stop();Et(this,dn,!0),Et(this,un,!1),Et(this,Kt,new MediaRecorder(j)),Re(this,Kt).start();const I=new Date().getTime();Et(this,Tn,I),Et(this,rn,I),Re(this,pn).call(this),Re(this,En).call(this),Re(this,Kt).addEventListener("dataavailable",o=>{D.push(o.data)}),Re(this,Kt).addEventListener("stop",async()=>{Et(this,dn,!1);const o=new Date().getTime();Et(this,On,o),Et(this,an,Re(this,an)+(o-Re(this,rn))),Re(this,pn).call(this),clearInterval(Re(this,hn));const k=j.getTracks();for(const Y of k)Y.stop();if(Re(this,Kt)===null)return;const N=new Blob(D,{type:Re(this,Kt).mimeType}),F=await fixWebmDuration(N),J=URL.createObjectURL(F),X=document.createElement("a");X.href=J,X.download=`${z}.mp4`,X.click(),URL.revokeObjectURL(J),D=[],Et(this,Kt,null)})})});Se(this,"pause",async()=>{var D;await new Promise(j=>setTimeout(()=>j(!0),300)),(D=Re(this,Kt))==null||D.pause(),Et(this,un,!0);const z=new Date().getTime();Et(this,an,Re(this,an)+(z-Re(this,rn))),Re(this,pn).call(this),clearInterval(Re(this,hn))});Se(this,"resume",async()=>{var D;(D=Re(this,Kt))==null||D.resume(),Et(this,un,!1);const z=new Date().getTime();Et(this,rn,z),Re(this,pn).call(this),Re(this,En).call(this)});Se(this,"stop",async()=>{var z;(z=Re(this,Kt))==null||z.stop()});Se(this,"getDuration",()=>{if(Re(this,rn)===0)return 0;let z=Re(this,an);const D=new Date().getTime();if(Re(this,dn)&&Re(this,un)===!1){const j=D-Re(this,rn);Et(this,rn,D),z=z+j}return z});Se(this,"getInfo",()=>({active:Re(this,dn),pause:Re(this,un),startTime:Re(this,Tn),endTime:Re(this,On),duration:Re(this,an)}));Xe(this,pn,()=>{const z=this.getInfo();this.onchange(z)});Xe(this,En,()=>{clearInterval(Re(this,hn)),Et(this,hn,window.setInterval(()=>{Et(this,an,this.getDuration()),this.onDurationChange(Re(this,an))},500))})}}Kt=new WeakMap,dn=new WeakMap,un=new WeakMap,Tn=new WeakMap,On=new WeakMap,rn=new WeakMap,an=new WeakMap,hn=new WeakMap,pn=new WeakMap,En=new WeakMap;var l=Object.defineProperty,y=$=>{throw TypeError($)},q=($,z,D)=>z in $?l($,z,{enumerable:!0,configurable:!0,writable:!0,value:D}):$[z]=D,s=($,z,D)=>q($,typeof z!="symbol"?z+"":z,D),P=($,z,D)=>z.has($)||y("Cannot "+D),n=($,z,D)=>(P($,z,"read from private field"),D?D.call($):z.get($)),a=($,z,D)=>z.has($)?y("Cannot add the same private member more than once"):z instanceof WeakSet?z.add($):z.set($,D),d,x,u;class p{constructor(z={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(D,j={})=>new Promise(async(O,I)=>{const o=j.timeout||this.options.timeout,k=j.key||n(this,d).call(this),N=j.describe||"";if(this.queue.findIndex(J=>J.key===k)!==-1)return I(`${k} is exist.`);const F={key:k,func:D,describe:N,timeout:o,resolve:O,reject:I};this.queue.unshift(F),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,D=>{const j=this.queue.findIndex(O=>O.key===D);this.queue.splice(j,1)}),a(this,u,async()=>{const D=this.queue.length;if(D===0)return;const j=D-1,O=this.queue[j];this.activePromise=O;const{key:I,func:o,resolve:k,reject:N,timeout:F}=this.activePromise;F&&(this.timer=window.setTimeout(()=>{N(`pr-async-queue: ${I} is timeout.`),n(this,u).call(this)},F)),await o().then(k).catch(N).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,x).call(this,I),n(this,u).call(this)})}),this.options={timeout:0,...z}}}d=new WeakMap,x=new WeakMap,u=new WeakMap;class RoomBase{constructor(z){Se(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});Se(this,"sdk_service_version","1.0.6");Se(this,"prohibitNotify",!1);Se(this,"isEarly",!1);Se(this,"isInRoom",!1);Se(this,"asyncQueue");Se(this,"roomState","ready");Se(this,"createAt",Date.now());Se(this,"cwsIns");Se(this,"peerIns");Se(this,"transceiverMap",new Map);Se(this,"sendChannel");Se(this,"receiveChannel");Se(this,"userMap",new Map);Se(this,"setLocalStreamActiveMap",new Map);Se(this,"phoneyStreams",new Map);Se(this,"recorder",new StreamRecorder);Se(this,"networkQualityTester",new NetworkQualityTester);Se(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Se(this,"reportLogs",(z,D="未知错误")=>{const{appid:j,userId:O,earlyId:I="",logUrl:o,reportErr:k}=this.options;if(!k)return;const N="web",F=J=>({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})[J].toString();{const J=F(z),X={origin:N,type:J,app_id:j,user_id:O,ins_id:I,desc:D},Y=btoa(encodeURI(JSON.stringify(X))),Q=`${o}/upload/log?log_key=${Y}`;{const te=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ne=new TextEncoder().encode(te),oe=pako.deflate(ne,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:X,url:Q,size:lt(oe.byteLength)}),fetch(Q,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:oe})}}});Se(this,"initPhoneyStreams",(z,D=[])=>{D.length===0&&(D=mediaType_keys);for(const j of D){const O=this.phoneyStreams.get(j);if(O){const I=O.getTracks();for(const o of I)o.stop()}switch(j){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(z));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(z));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Se(this,"getPhoneyStreams",z=>this.phoneyStreams.get(z));Se(this,"getRoomInfo",()=>{const{options:z,roomState:D,createAt:j}=this;return{...z,roomState:D,createAt:j}});Se(this,"setRoomState",z=>{this.roomState=z;const D=enum_roomState[z],j={state:z,stateStr:D};this.cwsIns.emitNotify("onRoomState",{code:200,data:j,desc:"room state is change."})});Se(this,"setOptions",async z=>{const D={...this.options,...z};this.options=D});Se(this,"stopStream",async z=>{const D=z.getTracks();for(const j of D)j.stop()});Se(this,"getMediaDevicesErrInfo",async()=>{try{const z=await navigator.mediaDevices.enumerateDevices();z.find(j=>j.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),z.find(j=>j.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(z){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",z)}return this.mediaDevicesErrInfo});Se(this,"getUserMediaKey",(z,D)=>`${z}-${D}`);Se(this,"getCallAction",async z=>{let D="";const j=I=>z.findIndex(({type:k,enabled:N=!0})=>k===I&&N)===-1?"0":"1";return D=`${j(0)}${D}`,D=`${j(1)}${D}`,D=`${j(2)}${D}`,D=`${j(3)}${D}`,parseInt(D,2)});Se(this,"getCallActionMap",(z=0)=>{const j=Number(z).toString(2).padStart(4,"0").split(""),[O,I,o,k]=j;return{microphoneCamera_audio:!!Number(k),microphoneCamera_video:!!Number(o),screenSharing_video:!!Number(I),screenSharing_audio:!!Number(O)}});Se(this,"getBanBehaviorMap",(z=0)=>{const j=Number(z).toString(2).padStart(4,"0").split(""),[O,I,o,k]=j;return{microphoneCamera_audio:!!Number(k),microphoneCamera_video:!!Number(o),screenSharing_video:!!Number(I),screenSharing_audio:!!Number(O)}});Se(this,"getAverageVolume",(z,D)=>{z.getByteFrequencyData(D);let j=0;for(let I=0;I<D.length;I++)j+=D[I];return Math.ceil(j/D.length)});Se(this,"getTrackNamesFormTracks",(z,D=[],j="trackName")=>{const O=[];for(const I of z){const{type:o}=I;if(D.length===0||D.includes(o)){const k=I[j];k&&O.push(`${k}`)}}return O});Se(this,"usersFilter",z=>dt(z,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((O,I)=>O.id.localeCompare(I.id,"en")));this.setOptions(z),this.cwsIns=new CallsWebSocket({...z}),this.asyncQueue=new p}}var m=Object.defineProperty,G=($,z,D)=>z in $?m($,z,{enumerable:!0,configurable:!0,writable:!0,value:D}):$[z]=D,e$1=($,z,D)=>G($,typeof z!="symbol"?z+"":z,D);class g{constructor(z,D){e$1(this,"inputStream",new MediaStream),e$1(this,"outputStream",new MediaStream),e$1(this,"inputGain",1),e$1(this,"enhanceGain",1),e$1(this,"bgsGain",1),e$1(this,"bgmGain",1),e$1(this,"outputGain",1),e$1(this,"mixAudioMap",new Map),e$1(this,"audioContext",new AudioContext),e$1(this,"sourceNode"),e$1(this,"inputGainNode"),e$1(this,"enhanceGainNode"),e$1(this,"bgsGainNode"),e$1(this,"bgmGainNode"),e$1(this,"analyserNode"),e$1(this,"analyserArrayData"),e$1(this,"outputGainNode"),e$1(this,"destinationNode"),e$1(this,"filterStream",j=>j),e$1(this,"stop",()=>{{const j=this.inputStream.getTracks();for(const O of j)O.stop(),this.inputStream.removeTrack(O)}}),e$1(this,"getStream",()=>this.filterStream(this.outputStream)),e$1(this,"setMute",(j=!0)=>{j?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e$1(this,"setInputGain",j=>{this.inputGain=j,this.inputGainNode.gain.setValueAtTime(j,this.audioContext.currentTime)}),e$1(this,"setEnhanceGain",async j=>{this.enhanceGain=j+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e$1(this,"setBgsGain",j=>{this.bgsGain=j,this.bgsGainNode.gain.setValueAtTime(j,this.audioContext.currentTime)}),e$1(this,"setBgmGain",j=>{this.bgmGain=j,this.bgmGainNode.gain.setValueAtTime(j,this.audioContext.currentTime)}),e$1(this,"setOutputGain",j=>{this.outputGain=j,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e$1(this,"getVolume",()=>{const{analyserNode:j,analyserArrayData:O}=this;j.getByteFrequencyData(O);let I=0;for(let o=0;o<O.length;o++)I+=O[o];return Math.ceil(I/O.length)}),e$1(this,"mixAudio",(j,O="bgm")=>new Promise(async(I,o)=>{try{{const F=this.mixAudioMap.get(O);F&&F.stop()}const k=O==="bgs"?this.bgsGainNode:this.bgmGainNode,N=this.audioContext.createBufferSource();this.mixAudioMap.set(O,N),N.buffer=j,N.connect(k),N.onended=()=>{N.disconnect(k),this.mixAudioMap.delete(O),I(!0)},N.start(0)}catch(k){o(k)}})),e$1(this,"mixAudioStop",j=>{const O=this.mixAudioMap.get(j);O==null||O.stop()}),e$1(this,"changeMix",(j,O)=>{const I=j==="bgs"?this.bgsGainNode:this.bgmGainNode;O?I.connect(this.destinationNode):I.disconnect(this.destinationNode)}),D&&(this.audioContext=D),this.inputStream=z,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:j,inputGainNode:O,enhanceGainNode:I,bgsGainNode:o,bgmGainNode:k,analyserNode:N,outputGainNode:F,destinationNode:J}=this;j.connect(O),O.connect(I),I.connect(N),o.connect(N),k.connect(N),I.connect(J),o.connect(J),k.connect(J),N.connect(F),F.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(D){super(D);Xe(this,bn,[]);Xe(this,Qt,new Map);Xe(this,Ut,new Map);Xe(this,on,new Map);Xe(this,sn,new Map);Xe(this,fn,new Map);Se(this,"localStreamsActionMap",new Map);Xe(this,_n,new Map);Se(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Se(this,"initMediaPhoneyStreams",(D=[])=>this.initPhoneyStreams(this.audioContext,D));Se(this,"initLocalStreamsFilter",()=>{for(const D of mediaType_keys){const j=async O=>O;Re(this,_n).set(D,j)}});Se(this,"setLocalFilterStream",(D,j)=>{Re(this,_n).set(D,j)});Xe(this,Pn,()=>{Re(this,Ut).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),Re(this,Ut).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),Re(this,Ut).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),Re(this,Ut).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});Xe(this,Un,()=>{Re(this,Qt).set("audioinput","default"),Re(this,Qt).set("videoinput","default"),Re(this,Qt).set("audiooutput","default")});Se(this,"emitNotifyUpdateUsersStreams",async D=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:D,desc:"users streams is change."})});Se(this,"initUserMediaStreamContext",async(D,j,O)=>{const[I]=O.getTracks();if(!I){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:D,mediaType:j,stream:O});return}this.removeUserMediaStreamContext(D,j);const o=this.getUserMediaKey(D,j),{kind:k}=I;switch(k){case"audio":{const N=new MediaStream;N.addTrack(I);const F=new g(N,this.audioContext);Re(this,on).set(o,F)}break;case"video":{const N=new VideoMediaContext(I);Re(this,sn).set(o,N)}break}});Se(this,"getUserMediaStreamContext",(D,j)=>{const O=this.getUserMediaKey(D,j);if(["microphoneCamera_audio","screenSharing_audio"].includes(j))return Re(this,on).get(O);if(["microphoneCamera_video","screenSharing_video"].includes(j))return Re(this,sn).get(O)});Se(this,"getUserAudioMediaStreamContext",(D,j)=>{const O=this.getUserMediaKey(D,j);return Re(this,on).get(O)});Se(this,"removeUserMediaStreamContext",(D,j)=>{const O=this.getUserMediaKey(D,j);if(["microphoneCamera_audio","screenSharing_audio"].includes(j)){const I=Re(this,on).get(O);return I==null||I.stop(),Re(this,on).delete(O)}if(["microphoneCamera_video","screenSharing_video"].includes(j)){const I=Re(this,sn).get(O);return I==null||I.stop(),Re(this,sn).get(O)}});Se(this,"getUserStream",(D,j)=>{const O=this.getUserMediaStreamContext(D,j);return(O==null?void 0:O.getStream())||new MediaStream});Se(this,"getUserStreams",(D,j=[])=>{j.length===0&&(j=mediaType_keys);const O={};for(const I of j){const o=this.getUserStream(D,I);O[I]=o}return O});Se(this,"removeUserStreams",async(D,j=[])=>{j.length===0&&(j=mediaType_keys);for(const O of j)this.removeUserMediaStreamContext(D,O)});Se(this,"clearUserStreams",()=>{{const D=Re(this,on).values();for(const j of D)j.stop();Et(this,on,new Map)}{const D=Re(this,sn).values();for(const j of D)j.stop();Et(this,sn,new Map)}});Se(this,"setMediaTrackConstraints",async(D,j)=>{Re(this,Ut).set(D,j);const O=await this.getLocalStream(D);if(!O)return;const I=O.getTracks();if(I.length!==0)for(const o of I){const k=o.getConstraints(),F={...Re(this,Ut).get(D),...k,...j};await o.applyConstraints(F)}});Se(this,"stopLocalStreams",async(D=[])=>{D.length===0&&(D=mediaType_keys);for(const j of D){const O=Re(this,fn).get(j);O&&await this.stopStream(O),Re(this,fn).delete(j)}});Se(this,"addLocalStream",(D,j)=>{const O=Re(this,fn).get(D);O&&this.stopStream(O),Re(this,fn).set(D,j)});Se(this,"initLocalStream",async D=>{switch(D){case"microphoneCamera_audio":{const j=Re(this,Qt).get("audioinput"),O=Re(this,Ut).get("microphoneCamera_audio"),I=await navigator.mediaDevices.getUserMedia({audio:{deviceId:j,...O},video:!1});this.addLocalStream("microphoneCamera_audio",I)}break;case"microphoneCamera_video":{const j=Re(this,Qt).get("videoinput"),O=Re(this,Ut).get("microphoneCamera_video"),I=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:j,...O}});this.addLocalStream("microphoneCamera_video",I)}break;case"microphoneCamera":{const j=Re(this,Qt).get("audioinput"),O=Re(this,Qt).get("videoinput"),I=Re(this,Ut).get("microphoneCamera_audio"),o=Re(this,Ut).get("microphoneCamera_video"),N=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:j,...I},video:{deviceId:O,...o}})).getTracks();for(const F of N){const{kind:J}=F;if(J==="audio"){const X=new MediaStream;X.addTrack(F),this.addLocalStream("microphoneCamera_audio",X)}if(J==="video"){const X=new MediaStream;X.addTrack(F),this.addLocalStream("microphoneCamera_video",X)}}}break;case"screenSharing_audio":{const j=Re(this,Ut).get("screenSharing_audio"),I=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...j})).getTracks();for(const o of I){const{kind:k}=o;if(k==="audio"){const N=new MediaStream;N.addTrack(o),this.addLocalStream("screenSharing_audio",N)}}}break;case"screenSharing_video":{const j=Re(this,Ut).get(D),I=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...j})).getTracks();for(const o of I){const{kind:k}=o;if(k==="video"){const N=new MediaStream;N.addTrack(o),this.addLocalStream("screenSharing_video",N)}}}break;case"screenSharing":{const j=Re(this,Ut).get("screenSharing_audio"),O=Re(this,Ut).get("screenSharing_video"),o=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...j,...O})).getTracks();for(const k of o){const{kind:N}=k;if(N==="audio"){const F=new MediaStream;F.addTrack(k),this.addLocalStream("screenSharing_audio",F)}if(N==="video"){const F=new MediaStream;F.addTrack(k),this.addLocalStream("screenSharing_video",F)}}}break}});Se(this,"getLocalStream",async D=>{const j=Re(this,fn).get(D),O=Re(this,_n).get(D);let I=j;return j&&O&&(I=await O(j)),I});Se(this,"getLocalStreams",async(D=[])=>{D.length===0&&(D=mediaType_keys);const j={};for(const O of D)j[O]=await this.getLocalStream(O);return j});Xe(this,wn,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(D=>{const j=D.filter(O=>!["communications"].includes(O.deviceId));Et(this,bn,j.sort((O,I)=>O.label.localeCompare(I.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",D)}),Re(this,bn)));Xe(this,Ln,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await Re(this,wn).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),Re(this,wn).call(this)});Se(this,"getMediaDeviceKind",D=>Re(this,Qt).get(D));Se(this,"changeAudiooutput",async()=>{try{const D=Re(this,Qt).get("audiooutput");await this.audioContext.setSinkId(D)}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",D)}});Se(this,"setDeviceKind",(D,j)=>{Re(this,Qt).set(D,j)});Se(this,"setAudioOutputDevice",D=>this.setDeviceKind("audiooutput",D));Se(this,"getEnumerateDevices",async D=>(await Re(this,wn).call(this),Re(this,bn).filter(O=>O.kind===D)));Se(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Se(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Se(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));Re(this,Ln).call(this),Re(this,Un).call(this),Re(this,Pn).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var j;((j=this.audioContext)==null?void 0:j.state)==="suspended"&&this.audioContext.resume()})}}bn=new WeakMap,Qt=new WeakMap,Ut=new WeakMap,on=new WeakMap,sn=new WeakMap,fn=new WeakMap,_n=new WeakMap,Pn=new WeakMap,Un=new WeakMap,wn=new WeakMap,Ln=new WeakMap;class RoomUsers extends RoomMedias{constructor(D){super(D);Se(this,"getMaxVolumeUser",()=>{const D=Array.from(this.userMap.values(),({id:O})=>O);if(D.length===0)return;let j=[];for(const O of D){const I=this.getUserAudioMediaStreamContext(O,"microphoneCamera_audio");if(!I)continue;const o=I.getVolume();j.push({id:O,volume:o})}return j=j.sort((O,I)=>O.volume-I.volume>0?-1:1),j[0]});Se(this,"setVolume",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.setInputGain(O)});Se(this,"setEnhanceGain",async(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.setEnhanceGain(O)});Se(this,"setSpeaker",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.setOutputGain(O);const o=O===0;I==null||I.setMute(o)});Se(this,"playBgs",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);return I==null?void 0:I.mixAudio(O,"bgs")});Se(this,"setBgsGain",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.setBgsGain(O)});Se(this,"stopBgs",(D,j)=>{const O=this.getUserAudioMediaStreamContext(D,j);O==null||O.mixAudioStop("bgs")});Se(this,"playBgm",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);return I==null?void 0:I.mixAudio(O,"bgm")});Se(this,"setBgmGain",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.setBgmGain(O)});Se(this,"stopBgm",(D,j)=>{const O=this.getUserAudioMediaStreamContext(D,j);O==null||O.mixAudioStop("bgm")});Se(this,"changBgsMix",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.changeMix("bgs",O)});Se(this,"changBgmMix",(D,j,O)=>{const I=this.getUserAudioMediaStreamContext(D,j);I==null||I.changeMix("bgm",O)});Se(this,"getVolume",(D,j)=>{const O=this.getUserAudioMediaStreamContext(D,j);return O==null?void 0:O.getVolume()});Se(this,"clearUsers",()=>{this.userMap=new Map});Se(this,"removeUsers",async D=>{for(const j of D)this.userMap.delete(j),await this.removeUserStreams(j)});Se(this,"createUser",async D=>{const j=Date.now(),O={id:D,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:D===this.options.userId,isPublished:!1,joinTime:j,updateAt:j,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(D,O)});Se(this,"getUser",async D=>(this.userMap.has(D)||await this.createUser(D),this.userMap.get(D)));Se(this,"getUsers",async(D=[])=>{D.length===0&&(D=[...this.userMap.keys()]);const j=[];for(const O of D){const I=await this.getUser(O);j.push(I)}return j});Se(this,"getAllUserTrackMids",async()=>{const D=await this.getUsers(),j=[];for(const O of D){const{tracks:I=[]}=O;for(const o of I)j.push(o.mid)}return j});Se(this,"getUserTrackByTrackName",async D=>{const j=await this.getUsers(),O=[];for(const I of j){const{tracks:o=[]}=I;for(const k of o){const{trackName:N}=k;D.includes(N)&&O.push(k)}}return O});Se(this,"getUserTrackFromMid",async D=>{const j=await this.getUsers();let O;for(const I of j){const{tracks:o=[]}=I;for(const k of o)if(k.mid===D){O=k;break}}return O});Se(this,"checkUserInRoom",D=>this.userMap.has(D));Se(this,"getUsersId",async()=>[...this.userMap.keys()]);Se(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));Se(this,"updateIsPublished",async(D,j=!1)=>{const O=await this.getUser(D);O.isPublished=j});Se(this,"setUserUpdateStreams",async(D,j,O=!0)=>{const I=await this.getUser(D),o={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};o[j]=O,I.updateStreams=o});Se(this,"updateUserChannels",async(D,j=[],O)=>{const I=await this.getUser(D);O&&(j=[...I.channels,...j]),I.channels=j});Se(this,"updateUsertracks",async(D,j=[],O)=>{const I=await this.getUser(D);O&&(j=[...I.tracks,...j]),j=j.filter(({mid:N=""})=>N!==""),j=pt(j,["type"]),j=j.sort((N,F)=>N.type-F.type<0?-1:1);for(const N of j)N.userId=D,N.mediaType=mediaType_keys[N.type],N.enabled===void 0&&(N.enabled=!0);I.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const o=dt(I.tracks,["mediaType","enabled","mid","msid","trackName"]),k=dt(j,["mediaType","enabled","mid","msid","trackName"]);{const N="microphoneCamera_audio",F=k.find(Y=>Y.mediaType===N),J=o.find(Y=>Y.mediaType===N),X=JSON.stringify(F)!==JSON.stringify(J);I.updateStreams[N]=X}{const N="microphoneCamera_video",F=k.find(Y=>Y.mediaType===N),J=o.find(Y=>Y.mediaType===N),X=JSON.stringify(F)!==JSON.stringify(J);I.updateStreams[N]=X}{const N="screenSharing_audio",F=k.find(Y=>Y.mediaType===N),J=o.find(Y=>Y.mediaType===N),X=JSON.stringify(F)!==JSON.stringify(J);I.updateStreams[N]=X}{const N="screenSharing_video",F=k.find(Y=>Y.mediaType===N),J=o.find(Y=>Y.mediaType===N),X=JSON.stringify(F)!==JSON.stringify(J);I.updateStreams[N]=X}I.tracks=j});Se(this,"updateUserCallAction",async(D,j=0)=>{const O=await this.getUser(D);O.callAction=j,O.callActionStr=j.toString(2).padStart(4,"0"),O.callActionMap=this.getCallActionMap(j)});Se(this,"updateUserBehaviors",async(D,j=0)=>{const O=await this.getUser(D);O.banBehavior=j,O.banBehaviorStr=j.toString(2).padStart(4,"0"),O.banBehaviorMap=this.getBanBehaviorMap(j)});Se(this,"updateUserNetwork",async(D,j={egress:5,ingress:5})=>{const O=await this.getUser(D);O.network=j});Se(this,"updateUserPermissions",async(D,j)=>{if(j){const O=await this.getUser(D);O.permissions=j}});Se(this,"updateUserBase",async D=>{const j=await this.getUser(D);j.isSelf=D===this.options.userId,j.updateAt=Date.now()});Se(this,"updateUsers",async D=>{for(const j of D){const{id:O,tracks:I,callAction:o,permissions:k,isPublished:N}=j;await this.updateUserBase(O),await this.updateIsPublished(O,N),await this.updateUserPermissions(O,k),await this.updateUsertracks(O,I,!0),await this.updateUserCallAction(O,o),await this.updateUserNetwork(O)}});Se(this,"emitNotifyUpdateUser",async D=>{const j=await this.getUsers([D]),[O]=this.usersFilter(j);this.cwsIns.emitNotify("onRoomUser",{code:200,data:O,desc:"user info is change."})});Se(this,"emitNotifyUpdateUsers",async()=>{const D=await this.getUsers(),j=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:j,desc:"all users info is change."})})}}const t=($,z=4294967295,D=79764919)=>{const j=new Int32Array(256);let O,I,o,k=z;for(O=0;O<256;O++){for(o=O<<24,I=8;I>0;--I)o=2147483648&o?o<<1^D:o<<1;j[O]=o}for(O=0;O<$.length;O++)k=k<<8^j[255&(k>>24^$[O])];return k},e=($,z=t)=>{const D=ne=>new Uint8Array(ne.length/2).map((oe,ce)=>parseInt(ne.substring(2*ce,2*(ce+1)),16)),j=ne=>D(ne)[0],O=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach((ne,oe)=>O.set(ne,oe));const I=new Uint8Array($.length);let o,k,N,F=!1,J=0,X=42,Y=$.length>13&&$.substring(0,9)==="dynEncode",Q=0;Y&&(Q=11,k=j($.substring(9,Q)),k<=1&&(Q+=2,X=j($.substring(11,Q))),k===1&&(Q+=8,N=(ne=>new DataView(D(ne).buffer).getInt32(0,!0))($.substring(13,Q))));const te=256-X;for(let ne=Q;ne<$.length;ne++)if(o=$.charCodeAt(ne),o!==61||F){if(o===92&&ne<$.length-5&&Y){const oe=$.charCodeAt(ne+1);oe!==117&&oe!==85||(o=parseInt($.substring(ne+2,ne+6),16),ne+=5)}if(o>255){const oe=O.get(o);oe&&(o=oe+127)}F&&(F=!1,o-=64),I[J++]=o<X&&o>0?o+te:o-X}else F=!0;const ie=I.subarray(0,J);if(Y&&k===1){const ne=z(ie);if(ne!==N){const oe="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",oe+`
|
|
14
|
+
`,"Expected: "+N+"; Got: "+ne+`
|
|
15
|
+
`,"Visit https://github.com/eshaz/simple-yenc for more information"),Error(oe)}}return ie};function WASMAudioDecoderCommon(){const $=Uint8Array,z=Float32Array;WASMAudioDecoderCommon.modules||Object.defineProperties(WASMAudioDecoderCommon,{modules:{value:new WeakMap},setModule:{value(D,j){WASMAudioDecoderCommon.modules.set(D,Promise.resolve(j))}},getModule:{value(D,j){let O=WASMAudioDecoderCommon.modules.get(D);return O||(j?O=WebAssembly.compile(e(j)):(j=D.wasm,O=WASMAudioDecoderCommon.inflateDynEncodeString(j).then(I=>WebAssembly.compile(I))),WASMAudioDecoderCommon.modules.set(D,O)),O}},concatFloat32:{value(D,j){let O=new z(j),I=0,o=0;for(;I<D.length;)O.set(D[I],o),o+=D[I++].length;return O}},getDecodedAudio:{value:(D,j,O,I,o)=>({errors:D,channelData:j,samplesDecoded:O,sampleRate:I,bitDepth:o})},getDecodedAudioMultiChannel:{value(D,j,O,I,o,k){let N=[],F,J;for(F=0;F<O;F++){const X=[];for(J=0;J<j.length;)X.push(j[J++][F]||[]);N.push(WASMAudioDecoderCommon.concatFloat32(X,I))}return WASMAudioDecoderCommon.getDecodedAudio(D,N,I,o,k)}},inflateDynEncodeString:{value(D){return D=e(D),new Promise(j=>{const O=String.raw`dynEncode012804c7886d()((()>+*§§)§,§§§§)§+§§§)§+.-()(*)-+)(.7*§)i¸¸,3§(i¸¸,3/G+.¡*(,(,3+)2å:-),§H(P*DI*H(P*@I++hH)H*r,hH(H(P*<J,i)^*<H,H(P*4U((I-H(H*i0J,^*DH+H-H*I+H,I*4)33H(H*H)^*DH(H+H)^*@H+i§H)i§3æ*).§K(iHI/+§H,iHn,§H+i(H+i(rCJ0I,H*I-+hH,,hH(H-V)(i)J.H.W)(i)c)(H,i)I,H-i*I-4)33i(I.*hH(V)(H+n5(H(i*I-i(I,i)I.+hH,i*J+iHn,hi(I-i*I,+hH,H/H-c)(H,iFn,hi(I,+hH,H0n5-H*V)(J(,hH/H(i)J(H(V)(J(i)c)(H)H(i)H,c)(3H*i*I*H,i)I,4(3(-H(H,W)(H-I-H,i*I,4)3(3(3H,H-I1H+I,H.i)H1V)(J.i(v5(33H.-H(H,i(c)(H,i*I,4)333)-§i*I*+§H*iHn,hi73H,H(i)8(H+J+H)P*(H*V)(J-r,§H)P*,H.i)H+H,i)V)(-H*i*I*H+i)I+H-H.I.H,H-i)I,4)333Ã+)-§iø7i(^*(iü7I,*h+hH+iDn,h*hilI+i)I,+hH+,hH+iô7H,c)(i)H+i´8W)(H,I,H+i*I+4)-+hH(H)8*J-i(p5.*h*h*hH-i')u,hH(P*(J+,hH(P*0J,H(P*,n50H+H,H-b((3H(P*0i)I.4)3H-i¨*n5*H-iÅ*s,hi73H-i)J+V)&+I,H(H+V)æ,8(I.H(H*8*J-i(p51H-i)J+i¸7V)(H(H+iø7V)(8(J/H(P*0J+s,hi73H+H,H.J,I.H(P*(m5(H.H(P*,s5.+hH,m5*H(P*(J.H+H.H+H/U((b((H(H(P*0i)J+^*0H,i)I,4(3(3H(H.^*03H-i¨*o5)33i(73(3(3-H,H+i)c)(H,i*I,H+i)I+4)33i)I-3H-3!2)0§K(i2J,L(H,H(^*(H,H*^*4H,i(^*0H,i(^*DH,j(_*<H,H)P*(^*,H,H+P*(^*8*h*h+hH,i)8(I3i§I**h*h*h*h*h*h*hH,i*8(6+(),03H,j(_*@i*I-H,P*<J.i,J(H,P*8J/s50H,H.i+J0^*<i¦I*H.H,P*4J1J.U(*H.U((J2i')o5/H.U()I.H,H(^*<H0H1U((H.i0J.i§i0i')o5/H/H.H2J*H(J.q50H,P*0J/H*I-H,P*(J0,hH,P*,H-q,hi)I-423+hH*m5+H/H0H(H1U((b((H/i)I/H(i)I(H*i)I*4(3(3H,H.^*<H,H-^*04*3iØ1U((5+i(I(i¨7i1^*(i$6iè1^*(i°7iè6^*(i¬7iÈ6^*(+hH(iÈ*n,hiÈ*I(+hH(i¨,n,hi¨,I(+hH(iØ,n,hiØ,I(+hH(iè,o,hH,i-H(i0c)(H(i*I(4)33iè1i1H,i-iÈ*8)Bi(I(+hH(ido,hH,i-H(i-c)(H(i*I(4)33iÈ6iè6H,i-iF8)BiØ1i)b((41-H,i-H(i/c)(H(i*I(4)3(3(-H,i-H(i1c)(H(i*I(4)3(3(-H,i-H(i0c)(H(i*I(4)3(3(3H,H/^*0H,H(^*<3i(I*4*3H,H,i¸)^*TH,H,iø-^*PH,H,iX^*LH,H,i(^*HH,i-8(I(H,i-8(I-i¥I*H,i,8(I.H(iErH-iEr5)H(i©*I1H-i)I0i(i;H.i,J(i(H(i(rCJ(J*H*i;sCI*i¨1I-H(I/+hH/,hH,i-H-V)(i)H,i+8(c)(H/i)I/H-i*I-H*i)I*4)-H(i)i¨1I/+hH(H*o,hH,i-H/V)(i)i(c)(H/i*I/H(i)I(4)33i¤I*H,iø-H,i¸)H,i-i;8)5+H0H1I2i(I-+hH-H2p,hH,H,iP8*J*i(p5-H*i7u,hH,i-H-i)H*c)(H-i)I-4*3i(I/i+I.i+I(*h*h*hH*i86*(*)3H-m,hi£I*403H-i)H,W)-I/i*I(4)3i3I.i/I(3H2H,H(8(H.J(H-J.p,hi¢I*4.3H,i-H-i)I*+hH(,hH*H/c)(H*i*I*H(i)I(4)-H.I-4+3(3(33H,W)1m,hiI*4,3H,iø-H,i¸)H,i-H18)J(,hi¡I*H(i(p5,H1H,V)ú-H,V)ø-o5,3H,i(H,iXH,i-H1i)H08)J(,hi I*H(i(p5,H0H,V)H,V)o5,3H,H,iPH,iH8+I*4+3(3(3H,i$6i¬78+I*3H*H3m5(3i)I-H*i(r5)3H)H,P*0^*(H+H,P*<^*(H*I-3H,i2L(H-33Á)+(i¨03b+(,(-(.(/(0(1(2(3(5(7(9(;(?(C(G(K(S([(c(k({(((«(Ë(ë((*)(iø03O)()()()(*(*(*(*(+(+(+(+(,(,(,(,(-(-(-(-(i¨13M8(9(:(((0(/(1(.(2(-(3(,(4(+(5(*(6()(7(T7*S7US0U `;WASMAudioDecoderCommon.getModule(WASMAudioDecoderCommon,O).then(I=>WebAssembly.instantiate(I,{})).then(({exports:I})=>{const o=new Map(Object.entries(I)),k=o.get("puff"),N=o.get("memory").buffer,F=new $(N),J=new DataView(N);let X=o.get("__heap_base");const Y=D.length,Q=X;X+=4,J.setInt32(Q,Y,!0);const te=X;X+=Y,F.set(D,te);const ie=X;X+=4,J.setInt32(ie,F.byteLength-X,!0),k(X,ie,te,Q),j(F.slice(X,X+J.getInt32(ie,!0)))})})}}}),Object.defineProperty(this,"wasm",{enumerable:!0,get:()=>this._wasm}),this.getOutputChannels=(D,j,O)=>{let I=[],o=0;for(;o<j;)I.push(D.slice(o*O,o++*O+O));return I},this.allocateTypedArray=(D,j,O=!0)=>{const I=this._wasm.malloc(j.BYTES_PER_ELEMENT*D);return O&&this._pointers.add(I),{ptr:I,len:D,buf:new j(this._wasm.HEAP,I,D)}},this.free=()=>{this._pointers.forEach(D=>{this._wasm.free(D)}),this._pointers.clear()},this.codeToString=D=>{const j=[],O=new Uint8Array(this._wasm.HEAP);for(let I=O[D];I!==0;I=O[++D])j.push(I);return String.fromCharCode.apply(null,j)},this.addError=(D,j,O,I,o,k)=>{D.push({message:j,frameLength:O,frameNumber:I,inputBytes:o,outputSamples:k})},this.instantiate=(D,j)=>(j&&WASMAudioDecoderCommon.setModule(D,j),this._wasm=new D(WASMAudioDecoderCommon).instantiate(),this._pointers=new Set,this._wasm.ready.then(()=>this))}var browser,hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,browser=Worker),browser}var browserExports=requireBrowser();const NodeWorker=getDefaultExportFromCjs(browserExports),getWorker=()=>globalThis.Worker||NodeWorker;class WASMAudioDecoderWorker extends getWorker(){constructor(z,D,j,O){WASMAudioDecoderCommon.modules||new WASMAudioDecoderCommon;let I=WASMAudioDecoderCommon.modules.get(j);if(!I){let o="text/javascript",k,N=`'use strict';(${((F,J,X)=>{let Y,Q,te=new Promise(ie=>{Q=ie});self.onmessage=({data:{id:ie,command:ne,data:oe}})=>{let ce=te,we={id:ie},se;ne==="init"?(Object.defineProperties(F,{WASMAudioDecoderCommon:{value:J},EmscriptenWASM:{value:X},module:{value:oe.module},isWebWorker:{value:!0}}),Y=new F(oe.options),Q()):ne==="free"?Y.free():ne==="ready"?ce=ce.then(()=>Y.ready):ne==="reset"?ce=ce.then(()=>Y.reset()):(Object.assign(we,Y[ne](Array.isArray(oe)?oe.map(ye=>new Uint8Array(ye)):new Uint8Array(oe))),se=we.channelData?we.channelData.map(ye=>ye.buffer):[]),ce.then(()=>self.postMessage(we,se))}}).toString()})(${j}, ${WASMAudioDecoderCommon}, ${O})`;try{k=typeof process.versions.node<"u"}catch{}I=k?`data:${o};base64,${Buffer.from(N).toString("base64")}`:URL.createObjectURL(new Blob([N],{type:o})),WASMAudioDecoderCommon.modules.set(j,I)}super(I,{name:D}),this._id=Number.MIN_SAFE_INTEGER,this._enqueuedOperations=new Map,this.onmessage=({data:o})=>{const{id:k,...N}=o;this._enqueuedOperations.get(k)(N),this._enqueuedOperations.delete(k)},new O(WASMAudioDecoderCommon).getModule().then(o=>{this.postToDecoder("init",{module:o,options:z})})}async postToDecoder(z,D){return new Promise(j=>{this.postMessage({command:z,id:this._id,data:D}),this._enqueuedOperations.set(this._id++,j)})}get ready(){return this.postToDecoder("ready")}async free(){await this.postToDecoder("free").finally(()=>{this.terminate()})}async reset(){await this.postToDecoder("reset")}}const assignNames=($,z)=>{Object.defineProperty($,"name",{value:z})};function EmscriptenWASM($){function z(){}function D(_e){throw _e}var j,O;function I(){var _e=O.buffer;j=new Uint8Array(_e),new BigInt64Array(_e),new BigUint64Array(_e)}for(var o=()=>D(""),k=()=>{},N={},F=_e=>_e(),J=()=>performance.now(),X=(_e,De)=>{if(N[_e]&&(clearTimeout(N[_e].id),delete N[_e]),!De)return 0;var je=setTimeout(()=>{delete N[_e],F(()=>ve(_e,J()))},De);return N[_e]={id:je,timeout_ms:De},0},Y=Math.cos,Q=_e=>(j.length,!1),te=_e=>{throw`exit(${_e})`},ie=new Uint8Array(123),ne=25;ne>=0;--ne)ie[48+ne]=52+ne,ie[65+ne]=ne,ie[97+ne]=26+ne;ie[43]=62,ie[47]=63;var oe={d:o,c:k,e:X,a:Y,f:Q,b:te};function ce(_e){we=_e.i,se=_e.j,ye=_e.k,fe=_e.l,pe=_e.m,ve=_e.o}var we,se,ye,fe,pe,ve;function Te(_e){_e.h()}EmscriptenWASM.wasm||Object.defineProperty(EmscriptenWASM,"wasm",{get:()=>String.raw`dynEncode0158c8b8d85e¼æ=M]lGu³õPo]ÐãÞ·£3² ÁÚ= Êöc/ÓZ8s³íÛ³uÐ¥t"+¦¦~dòR\(nº}÷£¢¢ë¢k}t¡) ,äÕüP
|
|
16
16
|
*øüäÖeùiÝWͦÖPM¨[æu>Ü(«l'Ë$c¿9ZEúº¼ù¼=}äÍÂý²\åôÒ
'.õtÅXî=}~õ"uÊrÁýóòÝ ÔúéÊ
|
|
17
17
|
/Îÿ4ñ3sl¬8mæÑå68à8uNÑçmhÔ¶©hwÒ½¸t¡î¾¾|®½®ê²
|
|
18
18
|
#Hzò44Bv½!;1Û÷Ô±xü½#Ó7(
0#,È$Ï#$$GÓéËEä àoç7ãoéJÉíï7±çOHAWáì@ì>j_»·ÄBg¡& ºËáPÍþÕâ|óZ5qíê£1(£=Mj»-³;Éb¸mÍIÙãË[@ºk¶äáV9t#wäÔy£óþN÷¸åKS W£)ýÌQ<¼°ì=}=}ÊÌ@㼤j@V¸0Wïú!÷ý£¾±²BMïðô=MãÕ2Úÿ¤ÜïV&¸áÇòßBÕØ&eÞj«@ߥ¬/Ï©Ì).ø~|V}o:¶çBj '¯ÅIÝBVU0¦~VBq´µOF#ÑÈVï ó>±w
5ooø«òÏ©2ú*Yó×&Øscò,óWû® =M«À3ÃUK£AhV!.ßÖª33pêPÃ¥¢;×òZ¹N´*Rwç²Ã= +2pæOôïÈ5 È5p£µ~ØÎE2¿×zÝê
LÂP7]O(&³BTJn6ì¬vøzýOb_¯ëSº [Þá4'þI&xa^ík¨a¨(bñý"w®×µØg),LèÏþ¬1×ü= àúN(5F:kTçZòË"êþÄUÏa%/Áïâ×*Ï3}~èKKnw][sÆ\3²( ¥o)1|()¥Õå¾!?= Ó¹O4xÙ¨ÌÕÆh£§×w¬¢¾9B{ÍØJÙ÷Âwf«E¢ÒpBÒGïÎUW¾£ÓYáG»mU^ðÛ7Lôyí¾7Nì?}Ádt|Öñåu&qýq¶
|
|
@@ -203,4 +203,4 @@ DÙ VààͳÄvÒ2; 5c±-ìÊöª§}Ou¡¡¦îGÇ D
|
|
|
203
203
|
Ùup3q@ݱuXtX07=Mp_¤I¬ø®®[¦ó[ÀRVsX?F^":ha?ØÎeÄQc{Yíz0j¹{b ×c4ö= %¡ì?XÜñÊ,xþÀf©ûyO}:Fà= NuÙO_hÌÍtÝg|ȳ]²(a= TÜøN»j/Ì|éÚ{^ëÐÖ{¡Çzñú_|Åûl*Ztì{8¯a@©¥ZKبc¿i<±üFÇkº-cy5±4§o9Ñ,;KzÌ $à1I=MºôÉ©¤=MêÈ5
|
|
204
204
|
}õíë(ðìÍäWD?£©ÿãª=MäÒ±ì6í)ÏÙtbFÐöÚFÈ´Ù§R1.]¢¦¨ùû,9ïtö»LÂôâ¦qªk{ä(9«4>°»B¶ñ»GÓ½vÃâ£d$°A0ô¼¦d=M¢«£Àß}â$æ0òÊ6¾%¼>3(
-D+ÂÔÂ
o7#æFåEIîkNDÒ_&3iÍHÌúk&@âk1ýîW¶Y¬XÞXáXâ¢XEeØØÈ\gi,Ç~æ{
Ü-ïÈÛx6Û{í8+¾\g¦ñÛírô9³®°3D_åãxQÈxþÚ·/ª= Íu_ÌuL^t^{g9áq?ª(üo!*Írâ&ÃËì÷¨Pd׺ÓG)àþê¤sJ
ñAÉå$AÐNÎçõnD1MøhO¥me Qʸ[F< ^MBÜÛ
|
|
205
205
|
Aãϧüï4î%M°6M
ùtN)FR[¾FqV6¥óðlò©Ë= c»R=}Ù8õ.%BÂIµÃI&æ×U1Q«Ïñ3&ÑóÓÝ»ñ²eL°(ÑòOzBð·Q]üôföê+h.³´)ÅKé¥JR#/GóuÉɾ¯Áõ¿-½ñ'î<·Q¼=MÛ²6+þçYdb_öcHmöôزj¾
nÚ7aÌvØOå¹÷e0FfÂÊÈønØ#?ÁhÊÀcÝåõ(åû)ü)éðк¿ÓÜ¡]qákÈÛÝL·ºrCMmp_ÀÏ Óìcç6®þsosÒÝóô1¬Ã6<2#Ò±C65Q"4B&pç
|
|
206
|
-
gUn
g= !þ+µèm M½Êê½½²¦é%0Yg~´p5.\Ø®zy9%ÔiÜ!ÙcÝŦH>ÓXÿZR[¬&ønÇlÓ_:ïi«ñ<ø"QÚ©yz
®ªOL¥ÎêÌÝi?Ê'/Ne»:2NÅÝ_òspüR Oø!!ù+##üÓkéªX-fpdq[U*]@ ö¨5ÍpÖYhܪ= ÛN3{ü® À)¡9þ-1® ÂcBNö÷0+È6òÒÑ;lÅ^_>ÓÛQ&jðMI줳àlS×j΢@ÈåÕ¢on=M°©xÉûÖäav=MM©²öÖ¹?{ÃßîøyÛ= 0òûÏ4grèNÒíÏqëðð-êö¸á¥$¨Q.Ò4ä¿V$N_Ý><´æë[â²F#T1É'utÿZXÁ(oàx¡Jo"öùSæ÷ÒUFÓs* U¡ÓºUµøGáL¨÷©ASjÕ®'!L¢ÕvC¿m·Gâ¼N¹³OÃã§1T:ê¹\Z£ËZæ.î}ª°O'ãà ¾I;ûÁHÃä&ÃÐÐK@3EÅÓÉ>½e@ã/òi¡|ÃE³{ñSCm
ÎëöÁÐÐ%Ó>d''¶9Á/T.N?äª æÿÀÐÐ%Ó¶ö¾ì¦)ÃÕ÷×"e|ÃþBåýrv¶K6öuâÐÌRÎËýæ×%IOIø¦Ä(HTJ~),ÕDCWWÃö(VwV=M§TsLP³ þV'tT#¡ZLêé;ßù[`});var be={a:se};this.setModule=Se=>{N.setModule(EmscriptenWASM,Se)},this.getModule=()=>N.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(Se=>WebAssembly.instantiate(Se,be)).then(Se=>{const Me=Se.exports;fe(Me),I=Me.g,D(),Ie(Me),Z()}),this.ready=new Promise(Se=>{Z=Se}).then(()=>{this.HEAP=I.buffer,this.malloc=ue,this.free=ye,this.opus_frame_decoder_create=ge,this.opus_frame_decode_float_deinterleaved=_e,this.opus_frame_decoder_destroy=pe}),this)}function OpusDecoder(N={}){OpusDecoder.errors||Object.defineProperties(OpusDecoder,{errors:{value:new Map([[-1,"OPUS_BAD_ARG: One or more invalid/out of range arguments"],[-2,"OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer"],[-3,"OPUS_INTERNAL_ERROR: An internal error was detected"],[-4,"OPUS_INVALID_PACKET: The compressed data passed is corrupted"],[-5,"OPUS_UNIMPLEMENTED: Invalid/unsupported request number"],[-6,"OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed"],[-7,"OPUS_ALLOC_FAIL: Memory allocation has failed"]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(K=>{this._common=K,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);const te=this._common.allocateTypedArray(this._channels,Uint8Array);te.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,te.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=K=>{if(!(K instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof K);this._input.buf.set(K);let te=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,K.length,this._output.ptr),ne;return te<0&&(ne="libopus "+te+" "+(OpusDecoder.errors.get(te)||"Unknown Error"),console.error(ne),te=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,te),samplesDecoded:te,error:ne}},this.decodeFrame=K=>{let te=[];const ne=this._decode(K);return ne.error&&this._common.addError(te,ne.error,K.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=K.length,this._outputSamples+=ne.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(te,[ne.outputBuffer],this._outputChannels,ne.samplesDecoded,this._sampleRate)},this.decodeFrames=K=>{let te=[],ne=[],ee=0,re=0;for(;re<K.length;){const ce=K[re++],oe=this._decode(ce);te.push(oe.outputBuffer),ee+=oe.samplesDecoded,oe.error&&this._common.addError(ne,oe.error,ce.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=ce.length,this._outputSamples+=oe.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(ne,te,this._outputChannels,ee,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const Z=8,q=K=>typeof K=="number",J=N.sampleRate,I=N.channels,D=N.streamCount,a=N.coupledStreamCount,O=N.channelMappingTable,F=N.preSkip,z=N.forceStereo?1:0;if(I>2&&(!q(D)||!q(a)||!Array.isArray(O)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(J)?J:48e3,this._channels=q(I)?I:2,this._streamCount=q(D)?D:1,this._coupledStreamCount=q(a)?a:this._channels-1,this._channelMappingTable=O||(this._channels===2?[0,1]:[0]),this._preSkip=F||0,this._forceStereo=I<=Z&&I!=2?z:0,this._inputSize=32e3*.12*this._channels,this._outputChannelSize=120*48,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}class OpusDecoderWebWorker extends WASMAudioDecoderWorker{constructor(Z){super(Z,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(Z){return this.postToDecoder("decodeFrame",Z)}async decodeFrames(Z){return this.postToDecoder("decodeFrames",Z)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(q){super(q);Ee(this,"getPeerStatsTimer",0);Ee(this,"reports",[]);Ee(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Ee(this,"initPeer",()=>{var q;(q=this.peerIns)==null||q.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),De(this,Hn).call(this),De(this,zn).call(this)});Ee(this,"getNatType",async()=>{});Ee(this,"initSendChannel",(q="",J)=>{});Ee(this,"initReceiveChannel",(q="",J)=>{});Ee(this,"replaceSenderStream",async(q=[],J)=>{const{userId:I}=this.options;q.length===0&&(q=mediaType_keys);for(const D of q){const a=this.transceiverMap.get(D);let O;if(a){const{sender:F}=a;J?O=this.getUserStream(I,D):O=this.getPhoneyStreams(D);const[z]=O.getTracks();z&&await F.replaceTrack(z)}}});Ee(this,"getSenderTracks",async(q=[])=>{const J=[];for(const I of q){const D=this.transceiverMap.get(I);if(!D)continue;const{mid:a,sender:O}=D,{track:F}=O;if(!F)continue;const{id:z,enabled:K}=F,te=mediaType_keys.findIndex(ee=>ee===I),ne={type:te,enabled:K,trackName:`web-${te}-${z}`,location:"local",mid:a};J.push(ne)}return J});Ee(this,"addSenders",async(q=[])=>{q.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const J=[];for(const I of q){if(this.transceiverMap.get(I))continue;const a=this.getPhoneyStreams(I),[O]=a.getTracks(),F=this.peerIns.addTransceiver(O,{direction:"sendonly"});this.transceiverMap.set(I,F),J.push(I)}if(q.length===0||J.length!==0){const I=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse(I.sdp),a=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:a,sdpJson:D,description:I})}await this.peerIns.setLocalDescription(I)}return J});Ee(this,"removeSenders",async(q=[])=>{q.length===0&&(q=mediaType_keys);for(const J of q)this.transceiverMap.has(J)&&this.transceiverMap.delete(J)});Ee(this,"onSubscribeUserTracks",q=>{let J=0;return new Promise(async I=>{const D=[];for(const a of q){const{tracks:O=[]}=a;for(const F of O){const{trackName:z,mid:K}=F,[te]=await this.getUserTrackByTrackName([z]);D.push({...te,mid:K})}}{let a=[];const O=async()=>{clearTimeout(J);const z=new Map;for(const te of a){const{userId:ne,mediaType:ee}=te;if(!ne||!ee)continue;z.has(ne)||z.set(ne,{userId:ne,tracks:[],updateStreams:{}});const ce=z.get(ne);ce.tracks.push(te),ce.updateStreams[ee]=!0}const K=[...z.values()];for(const te of K){const{userId:ne,tracks:ee}=te;await this.updateUsertracks(ne,ee,!0)}await this.emitNotifyUpdateUsersStreams(K),this.peerIns.removeEventListener("track",F);{const te=Array.from(D,re=>re.trackName),ne=Array.from(a,re=>re.trackName),ee=te.filter(re=>!ne.includes(re));I({target:te,success:ne,fail:ee})}},F=async z=>{const{streams:K,transceiver:te}=z,[ne]=K,{mid:ee,receiver:re}=te,{track:ce}=re,{id:oe}=ce,se=D.find(ue=>ue.mid===`${ee}`);if(!se)return;const{userId:fe,mediaType:ge}=se;if(!(!fe||!ge)){{const ue={...se,mid:ee,msid:oe};a.push(ue)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${a.length}/${D.length}`,{mediaType:ge,mid:ee,userTrack:se,e:z});{const ue=new Audio;if(ue.srcObject=ne,await this.initUserMediaStreamContext(fe,ge,ne),ge==="microphoneCamera_audio"||ge==="screenSharing_audio"){const _e=this.getUserAudioMediaStreamContext(fe,ge);_e==null||_e.setMute(!1)}}D.length===a.length&&O()}};this.peerIns.addEventListener("track",F),J=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${a.length}/${D.length})`),O()},5*1e3)}})});at(this,Hn,()=>{let q=0;const J=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=async()=>{const I=this.peerIns.iceConnectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(q),I){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${I}`),await this.taskQueue.setCondition("ice",!0),this.setRoomState("connected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${I}`),q=window.setTimeout(J,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${I}`),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:${I}`),J();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${I}`);break}}});Ee(this,"closeUserTracks",async(q,J=[],I=!1)=>{const D=[];for(const z of J){const{trackName:K,msid:te}=z;D.push(K),te&&D.push(te)}const a=z=>D.includes(z),O=this.peerIns.getTransceivers();for(const z of O){const{mid:K,sender:te,receiver:ne}=z;te.track&&a(te.track.id)&&(z.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${K} is stop.`,z)),ne.track&&a(ne.track.id)&&(z.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${K} is stop.`,z))}const F=await this.getUser(q);if(F){for(const z of F.tracks){const{trackName:K,msid:te,userId:ne,mediaType:ee}=z;!ne||!ee||!a(K)||(this.removeUserMediaStreamContext(ne,ee),te&&delete z.msid)}if(I){const z=F.tracks.filter(({trackName:K})=>!a(K));await this.updateUsertracks(q,z,!1)}}});Ee(this,"createOffer",async()=>{const q=await this.peerIns.createOffer();if(this.options.debug){const J=libExports$1.parse(q.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:I,sdpJson:J,description:q})}await this.peerIns.setLocalDescription(q)});Ee(this,"createAnswer",async()=>{const q=await this.peerIns.createAnswer();if(this.options.debug){const J=libExports$1.parse(q.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:I,sdpJson:J,description:q})}await this.peerIns.setLocalDescription(q)});Ee(this,"getSdp",()=>{var q;return(q=this.peerIns.localDescription)==null?void 0:q.sdp});Ee(this,"setRemoteDescription",async q=>{if(this.options.debug){const J=libExports$1.parse(q.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:I,sdpJson:J,description:q})}return await this.peerIns.setRemoteDescription(q),q});Ee(this,"setCallStrategy",async(q,J=[])=>{J.length===0&&(J=mediaType_keys);let I="balanced";switch(q){case"qualityPriority":I="maintain-resolution";break;case"fluencyPriority":I="maintain-framerate";break;case"balancedDowngrade":I="balanced";break}const D=await this.getSelfInfo(),a=Array.from(D.tracks,({trackName:F})=>F),O=this.peerIns.getSenders();for(const F of O){const{track:z}=F;if(!z||!a.includes(z.id))continue;const K=F.getParameters();F.setParameters({...K,degradationPreference:I})}});Ee(this,"setRTCRtpSenderParameters",q=>{try{const J=this.peerIns.getSenders();for(const I of J){const D=I.getParameters();I.setParameters({...D,...q})}}catch(J){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",J)}});Ee(this,"getReportsByMid",async(q=[])=>q.length===0?this.reports:this.reports.filter(J=>q.includes(J.mid)));Ee(this,"getRoomNetwork",()=>this.peerNetwork);Ee(this,"getPeerNetwork",()=>this.peerNetwork);at(this,jn,async()=>{try{const q=await this.peerIns.getStats(),J=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],D=[...q.values()].filter(_e=>J.includes(_e.type));let a=0,O=0,F=0,z=0,K=0,te=0,ne=[],ee=[];for(const _e of this.reports){const{packetsSent:pe,packetsLost:ye}=_e;pe&&(F+=pe),ye&&(z+=ye)}this.reports=D;for(const _e of this.reports){const{bytesSent:pe,bytesReceived:ye,packetsSent:we,packetsLost:Ie,roundTripTime:be,jitter:Se}=_e;pe&&(O=pe),ye&&(a=ye),we&&(K+=we),Ie&&(te+=Ie),be&&ne.push((be*100).toFixed(2)),Se&&ee.push(Se.toFixed(2))}ee.sort().reverse(),ne.sort().reverse();const re=K-F,ce=te-z,oe=re===0?"0.00":(ce/re).toFixed(2),[se="0"]=ne,[fe="0"]=ee,ge={outboundBytes:O,inboundBytes:a,lostRate:oe,roundTripTime:se,jitter:fe};this.peerNetwork=ge;const ue=(_e,pe,ye)=>{const we=Number(_e),Ie=Number(pe),be=Number(ye);let Se="0";return we<.03&&Ie<100&&be<.05?Se="5":we<.06&&Ie<160&&be<.1?Se="4":we<.1&&Ie<250&&be<.15?Se="3":we<.15&&Ie<400&&be<.2?Se="2":Se="1",Number(Se)};{const _e=ue(oe,se,fe),pe=await this.getSelfInfo(),{network:ye}=pe,we={egress:_e,ingress:_e};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,we),JSON.stringify(ye)!==JSON.stringify(we)){this.emitNotifyUpdateUsers();const{userId:Se,roomId:Me}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...we,userId:Se,roomId:Me}},!1)}},3*1e3)}}catch(q){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",q)}});at(this,zn,()=>{const q=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||De(this,jn).call(this)};this.getPeerStatsTimer=window.setInterval(q,1*1e3)});Ee(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Hn=new WeakMap,jn=new WeakMap,zn=new WeakMap;class RoomCalls extends RoomPeer{constructor(q){super(q);at(this,Tn,0);Ee(this,"setLocalStream",(q,J)=>new Promise(async(I,D)=>{try{typeof q=="string"&&(q=[q]);for(const O of q)this.localStreamsActionMap.set(O,J);if(J){if(q.includes("microphoneCamera_audio")&&q.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):q.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):q.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):q.includes("screenSharing_audio")&&q.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):q.includes("screenSharing_audio")&&!q.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):q.includes("screenSharing_video")&&!q.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),q.includes("screenSharing_audio")){const O=await this.getLocalStream("screenSharing_audio");if(O){const F=O.getTracks();for(const z of F)z.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(q.includes("screenSharing_video")){const O=await this.getLocalStream("screenSharing_video");if(O){const F=O.getTracks();for(const z of F)z.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(q);const a=await this.getLocalStreams(q);this.cwsIns.emitNotify("onLocalStream",{code:200,data:a,desc:"local stream is change."}),I(a)}catch(a){D(a)}}));Ee(this,"setMediaDeviceKind",(q,J)=>new Promise(async(I,D)=>{this.setDeviceKind(q,J);const a=await this.getSelfInfo(),{id:O,tracks:F=[],callActionMap:z}=a,K=[],te=async ne=>{const ee=this.localStreamsActionMap.get(ne),re=F.find(oe=>oe.mediaType===ne),ce=z[ne];if(ee){K.push(ne),await this.stopLocalStreams([ne]);try{await this.initLocalStream(ne)}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([ne],!1),D(oe)}}if(re){const oe=await this.getLocalStream(ne);oe&&(await this.initUserMediaStreamContext(O,ne,oe),ce&&await this.replaceSenderStream([ne],!0))}{const oe=await this.getLocalStreams(K);this.cwsIns.emitNotify("onLocalStream",{code:200,data:oe,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),I(!0)}};q==="audioinput"&&te("microphoneCamera_audio"),q==="videoinput"&&te("microphoneCamera_video"),q==="audiooutput"&&(await this.changeAudiooutput(),I(!0))}));Ee(this,"changeScreenSharing",async q=>{const J=await this.getSelfInfo(),{tracks:I=[],callActionMap:D}=J;try{await this.setLocalStream(q,!0);for(const a of q)I.find(F=>F.mediaType===a&&D[a])&&await this.replaceSenderStream([a],!0)}catch(a){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",a)}});Ee(this,"createSession",()=>new Promise(async(q,J)=>{if(["connecting","connected"].includes(this.roomState))return q(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(I,D)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async a=>{const{code:O=0,desc:F,data:z}=a;if(O!==200)return D(F);const{remoteSdp:K}=z;if(this.options.debug){const te=libExports$1.parse(K),ne=dt(te.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:ne,sdpJson:te})}await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(te=>setTimeout(()=>te(!0),300)),success:async()=>{I(!0)},fail:async te=>{throw new Error(`ice connection failed: ${te}`)}}),await this.setRemoteDescription({type:"answer",sdp:K})})}catch(a){D(a)}}),success:async I=>{q(I)},fail:async I=>{this.reportLogs("ws_c_timeout",I.message||I),J(I)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));Ee(this,"earlyConnect",(q=[])=>{this.isEarly=!0,De(this,Cn).call(this),this.createSession(),q.length===0&&(q=["microphoneCamera_audio","microphoneCamera_video"]),De(this,An).call(this,q)});Ee(this,"joinRoom",async q=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(D,a)=>{try{this.setOptions(q),await De(this,Cn).call(this),this.clearUsers();const{roomId:O,userId:F,callType:z,sdkToken:K}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:z,roomId:O,user:{id:F,tracks:[],callAction:0},token:K},version:2}).then(async te=>{const{code:ne=0,desc:ee="服务器繁忙",data:re}=te;if(ne!==200)return a(ee);const{roomId:ce="",roomUsers:oe=[]}=re;if(ce!==O)return a("加入的房间不匹配");this.isInRoom=!0,this.taskQueue.setCondition("createTrack",!0),this.taskQueue.setCondition("publish",!0),this.taskQueue.setCondition("subscribe",!0),this.taskQueue.setCondition("renegotiate",!0),this.taskQueue.setCondition("closeTrack",!0),this.initHeartbeat(),this.createSession(),await this.updateUsers(oe);const se=[];for(const ge of oe){const{id:ue,channelCache:_e}=ge,{channels:pe=[]}=_e;await this.updateUserBehaviors(ue,ge.behavior),await this.updateUserChannels(ue,pe,!1),pe.length!==0&&se.push({userId:ue,channels:pe})}this.subChannel(se),await this.emitNotifyUpdateUsers();const fe=await this.getUsers();D(fe)})}catch(O){a(O)}}),success:async D=>{J(D)},fail:async D=>{this.reportLogs("join_room_error",D.message||D),I(D)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));Ee(this,"quitRoom",()=>new Promise(async q=>{const{roomId:J,userId:I}=this.options,D={roomId:J,user:{id:I}};try{this.isInRoom=!1,clearInterval(De(this,Tn)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(a){this.reportLogs("quit_room_error",a.message||a)}await new Promise(a=>setTimeout(()=>a(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:D}),q(!0)}));Ee(this,"quitRoomEx",()=>new Promise(async q=>{const{roomId:J,userId:I}=this.options,D={roomId:J,user:{id:I}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(a){this.reportLogs("quit_room_error",a.message||a)}await new Promise(a=>setTimeout(()=>a(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:D}),q(!0)}));Ee(this,"syncRoomInfo",()=>new Promise(async(q,J)=>{const{userId:I}=this.options,D=await this.getUser(I),{id:a=I,callAction:O=0}=D;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:a,callAction:O}}}).then(async F=>{if(F.code!==200)return J(F.desc);const z=F.data.users;this.clearUsers(),await this.updateUsers(z),await this.updateUsertracks(D.id,D.tracks,!1);{const K=await this.getUsers();q(K)}}).catch(F=>J(F))}));Ee(this,"checkInRoom",()=>new Promise(async(q,J)=>{const{userId:I}=this.options,D=await this.getUser(I),{id:a=I,callAction:O=0}=D;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:a,callAction:O}}}).then(async F=>F.code!==200?J(F.desc):F.data.users.find(te=>te.id===this.options.userId)?q(!0):q(!1)).catch(()=>q(!1))}));Ee(this,"publish",q=>new Promise(async(J,I)=>{{const D=await this.getSelfInfo(),{banBehaviorMap:a}=D;let O=!0;for(const F of q)if(a[F]){O=!1;break}if(O===!1)return I("publish is error: prohibited by administrator.")}try{await this.setLocalStream(q,!0)}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",D)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(D,a)=>{try{const O=await this.getSelfInfo(),F=[];for(const ee of q){{const re=this.getPhoneyStreams(ee);await this.initUserMediaStreamContext(O.id,ee,re)}{const re=await this.getLocalStream(ee);re?await this.initUserMediaStreamContext(O.id,ee,re):F.push(ee)}}const z=q.filter(ee=>!F.includes(ee)||["microphoneCamera_audio","microphoneCamera_video"].includes(ee));await this.replaceSenderStream(q,!1),await De(this,An).call(this,z);const K=await this.getSenderTracks(z),te=[...O.tracks,...K];await this.updateUsertracks(O.id,te,!0),F.length!==0&&await this.inactiveTracks(F,!1),z.length!==0&&await this.replaceSenderStream(z,!0);const ne=await this.getCallAction(te);await De(this,On).call(this,ne),await new Promise(ee=>setTimeout(()=>ee(!0),230)),De(this,Jn).call(this,q);{await this.emitNotifyUpdateUsers();const ee=await this.getSelfInfo();D(ee)}}catch(O){a(O)}}),success:async D=>{J(D)},fail:async D=>{this.reportLogs("publish_error",D.message||D),I(D)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));Ee(this,"stopPublish",(q=[])=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(D,a)=>{try{const O=await this.getSelfInfo();q.length===0&&(q=mediaType_keys);const F=O.tracks.filter(({mediaType:K})=>K&&q.includes(K)),z=async()=>{this.initMediaPhoneyStreams(q);const K=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),D(K)};if(F.length===0)return z();await this.replaceSenderStream(q,!0),await this.closeUserTracks(O.id,F,!0),await this.removeSenders(q);{const K=await this.getCallAction(O.tracks);await De(this,On).call(this,K)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:F}}).then(async K=>{const{code:te=0,data:ne,desc:ee}=K;if(te!==200)return a(ee);const{remoteSdp:re}=ne;await this.setRemoteDescription({type:"answer",sdp:re}),z()})}catch(O){a(O)}}),success:async D=>{J(D)},fail:async D=>{this.reportLogs("close_track_error",D.message||D),I(D)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ee(this,"subscribe",(q=[],J=3)=>new Promise(async(I,D)=>{const a=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(O,F)=>{try{const z=await this.getUsers();let K=[];for(const ee of z){const{isSelf:re,tracks:ce=[]}=ee;if(!re){const oe=ce.filter(({trackName:se,mid:fe=""})=>fe!==""&&(q.includes(se)||q.length===0));oe.length!==0&&K.push({...ee,tracks:oe})}}const te=async(ee={})=>{const re=Array.from(K,({id:oe})=>oe),ce=await this.getUsers(re);await this.emitNotifyUpdateUsers(),O({users:ce,detail:ee})};if(K.length===0)return te();const ne=[];for(const ee of K){const{id:re,tracks:ce}=ee,oe=dt(ce,["type","trackName"]),se={id:re,tracks:oe};ne.push(se)}this.cwsIns.sendMessage({event:"subscribe",data:{users:ne}}).then(async ee=>{const{code:re=0,data:ce,desc:oe}=ee;if(re===2017&&oe.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),re!==200)return F(oe);const{remoteSdp:se,users:fe=[]}=ce;this.onSubscribeUserTracks(fe).then(async ge=>{await this.renegotiate().then(()=>te(ge)).catch(ue=>F(ue))}).catch(ge=>{F(ge)}),await this.setRemoteDescription({type:"offer",sdp:se})})}catch(z){F(z)}}),success:async O=>{a.clear(),this.taskQueue.setCondition("subscribe",!0),I(O)},fail:async O=>{if(this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: subscribe error. surplus count is ${J}`),J>0)return await new Promise(F=>setTimeout(()=>F(!0),(3-J)*1e3)),J=J-1,a.retry();a.clear(),this.reportLogs("subscribe_error",O.message||O),this.taskQueue.setCondition("subscribe",!0),D(O)},complete:async()=>{}})}));Ee(this,"renegotiate",()=>new Promise(async(q,J)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(I=>{const{code:D=0,desc:a}=I;if(D!==200)return J(a);q(I)})}catch(I){J(I)}this.taskQueue.setCondition("renegotiate",!0)}));Ee(this,"stopSubscribe",(q=[])=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(D,a)=>{try{const O=await this.getUsers(),F=[];for(const K of O){const{tracks:te=[]}=K;for(const ne of te){const{type:ee,mid:re,trackName:ce,mediaType:oe,msid:se}=ne;if(!(!oe||!se)&&(q.length===0||q.includes(ce))){const fe={type:ee,mid:re,trackName:se};F.push(fe),await this.closeUserTracks(K.id,[ne])}}}const z=async()=>{await this.emitNotifyUpdateUsers(),D(!0)};if(F.length===0)return z();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:F}}).then(async K=>{const{remoteSdp:te}=K.data;await this.setRemoteDescription({type:"answer",sdp:te})}),z()}catch(O){a(O)}}),success:async D=>{J(D)},fail:async D=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",D),this.reportLogs("close_track_error",D.message||D),I(D)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ee(this,"inactiveTracks",async(q,J)=>new Promise(async I=>{const D=await this.getSelfInfo();if(!D||!D.id)return I(!0);const{tracks:a=[]}=D,O=[...a];for(let z of O){const{mediaType:K}=z;if(K&&q.includes(K)){z.enabled=J;const te=await this.getLocalStream(K);if(!te)continue;const ne=te.getTracks();for(const ee of ne)ee.enabled=J}}await this.replaceSenderStream(q,J);const F=await this.getCallAction(O);await De(this,On).call(this,F),await this.emitNotifyUpdateUsers(),I(!0)}));Ee(this,"setBanBehaviors",q=>new Promise(async(J,I)=>{try{const{roomId:D}=this.options,a=[];for(const O of q){const{id:F,banBehaviors:z}=O,K=Object.keys(z);if(K.length===0)continue;const te=[];for(const ee of K){const re=mediaType_keys.findIndex(se=>se===ee),ce=z[ee],oe={type:re,behavior:ce};te.push(oe)}const ne={id:F,behaviors:te};a.push(ne)}this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:D,users:a}}).then(async O=>{const{code:F=0,desc:z}=O;if(F!==200)return I(z);J(O)}).finally(()=>{})}catch(D){I(D)}}));Ee(this,"pubChannel",()=>new Promise(async(q,J)=>{const D=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:D}}).then(async a=>{const{code:O=0,data:F,desc:z}=a;if(O!==200)return J(z);const{channels:K=[]}=F;for(const te of K){const{channels:ne=[]}=te;for(const ee of ne){const{dataChannelName:re,id:ce}=ee;this.initSendChannel(re,ce)}}q(!0)}).catch(a=>{J(a)})}));Ee(this,"subChannel",(q=[])=>new Promise(async(J,I)=>{if(q.length===0)return J(!0);await this.taskQueue.createTask({describe:"subChannel",strict:!0,conditionKeys:["createWs","createSession","ice"],changeConditionKeys:[],func:()=>this.cwsIns.sendMessage({event:"subChannel",data:{channels:q}}).then(async D=>{const{code:a=0,data:O,desc:F}=D;if(a!==200)return I(F);const{channels:z=[]}=O;for(const K of z){const{channels:te=[]}=K;for(const ne of te){const{dataChannelName:ee,id:re}=ne;this.initReceiveChannel(ee,re)}}}),success:async D=>{J(D)},fail:async D=>{I(D)}})}));Ee(this,"debugger",()=>new Promise(async(q,J)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async I=>{if(I.code!==200)return J(I.desc);q(!0)}).catch(I=>{J(I)})}));Ee(this,"shutdown",()=>new Promise(async(q,J)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async I=>{if(I.code!==200)return J(I.desc);q(!0)}).catch(I=>{J(I)})}));Ee(this,"initHeartbeat",()=>{this.stopHeartbeat();const q=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),J=this.isInRoom?5*1e3:30*1e3;Ct(this,Tn,window.setInterval(q,J)),q()});Ee(this,"stopHeartbeat",()=>{clearInterval(De(this,Tn))});at(this,Jn,async q=>{const{roomId:J}=this.options;if(!J)return;const{id:I,tracks:D=[]}=await this.getSelfInfo(),a=D.filter(O=>O.mediaType&&q.includes(O.mediaType));a.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:J,user:{id:I,tracks:a}}})});at(this,On,async q=>new Promise(async(J,I)=>{const{roomId:D,userId:a}=this.options,O={roomId:D,user:{id:a,callAction:q}};await this.cwsIns.sendMessage({event:"updateCall",data:O}).then(async F=>{const{code:z=0}=F;if(z!==200)return I(F);await this.updateUserCallAction(a,q),J(q)}).catch(F=>I(F))}));at(this,Cn,()=>new Promise(async(q,J)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return q(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:I,roomId:D,userId:a}=this.options;if(!I)return J("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const O={c:I,r:D,v:this.sdk_service_version};if(this.isEarly){const z=xt();O.i=z,this.setOptions({earlyId:z})}else O.b=a;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",O);const F=btoa(encodeURI(JSON.stringify(O)));await this.cwsIns.connect(F),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),q(!0)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",I),this.reportLogs("ws_c_timeout",I.message||I),J(I)}}));at(this,An,async q=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(D,a)=>{try{await this.taskQueue.setCondition("createTrack",!1);const O=await this.addSenders(q),F=await this.getSenderTracks(O);if(F.length===0)return await this.taskQueue.setCondition("createTrack",!0),D(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:F,callAction:0}}).then(async z=>{const{code:K=0,desc:te,data:ne}=z;if(K!==200)return a(te);const{remoteSdp:ee}=ne;await this.setRemoteDescription({type:"answer",sdp:ee}),D(!0)})}catch(O){await this.removeSenders(q),a(O)}}),success:async D=>{J(D)},fail:async D=>{this.reportLogs("publish_error",D.message||D),I(D)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}Tn=new WeakMap,Jn=new WeakMap,On=new WeakMap,Cn=new WeakMap,An=new WeakMap;class Room extends RoomCalls{constructor(Z){super(Z)}}class QuickVO extends Room{constructor(q){super(q);at(this,bn,new Map);Ee(this,"reconstruct",async()=>{if(this.cwsIns.state!=="connected")return;this.setRoomState("ready"),this.initMediaPhoneyStreams(),this.taskQueue.clear(),this.initPeer(),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),await this.createSession();const q=[],J=[],I=await this.getUsers();for(const D of I){const{isSelf:a,callActionMap:O,tracks:F=[]}=D;if(a)for(const z of mediaType_keys)O[z]&&q.push(z);for(const z of F)z.msid&&J.push(z.trackName)}await this.syncRoomInfo(),await this.subscribe(J),await this.publish(q)});at(this,Wn,()=>{{const q=async J=>{const{state:I}=J.data;if(I==="closed"){const{roomId:D,userId:a}=this.options,O={roomId:D,user:{id:a}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:O}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}this.roomState==="failed"&&this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:q},!0)}{const q=async J=>{const{qualities:I=[]}=J.data,[D]=I;if(!(D&&D.userId===this.options.userId&&I.length===1)){for(const a of I){const{userId:O,egress:F,ingress:z}=a;this.checkUserInRoom(O)&&await this.updateUserNetwork(O,{egress:F,ingress:z})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:q},!0)}{const q=async J=>{const I=J.data.user;await this.updateUsers([I]),await this.updateUsertracks(I.id,I.track,!1),await this.updateUserBehaviors(I.id,I.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:q},!0)}{const q=async J=>{await this.removeUsers([J.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:q},!0)}{const q=async J=>{const{user:I}=J.data,{id:D,tracks:a=[],callAction:O=0}=I;if(await this.updateUserCallAction(D,O),await this.updateUserPermissions(D,3),await this.updateUsertracks(D,a,!0),this.options.newPublishAutoSubscribe){const F=this.getTrackNamesFormTracks(a);await this.subscribe(F)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:q},!0)}{const q=async J=>{const I=[J.data];this.subChannel(I)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:q},!0)}{const q=async J=>{const{id:I,tracks:D}=J.data.user;I!==this.options.userId&&(await this.closeUserTracks(I,D,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:q},!0)}{const q=async J=>{const{id:I,callAction:D}=J.data.user;this.checkUserInRoom(I)&&(await this.updateUserCallAction(I,D),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:q},!0)}{const q=async J=>{const{user:I}=J.data,{id:D,permissions:a=1}=I;a===1?await this.removeUsers([D]):a===3&&await this.updateUsers([I]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:q},!0)}{const q=async J=>{const{users:I}=J.data;for(const D of I){const{id:a,behavior:O}=D;await this.updateUserBehaviors(a,O)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:q},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async q=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Ee(this,"addNotify",q=>this.cwsIns.addNotify(q));at(this,Vn,()=>{});at(this,Zn,()=>{this.cwsIns.onReconnectSuccess=async()=>{await this.checkInRoom()?await this.reconstruct():this.setRoomState("closed")}});at(this,Kn,async()=>{this.cwsIns.onReconnectStop=async()=>{this.setRoomState("closed")}});Ee(this,"addRequestAnimationFrame",async(q,J)=>{{const D=De(this,bn).get(q);D&&cancelAnimationFrame(D)}const I=(D=Date.now())=>{J(D);const a=requestAnimationFrame(I);De(this,bn).set(q,a)};I()});Ee(this,"clearRequestAnimationFrame",async(q=[])=>{q.length===0&&(q=[...De(this,bn).keys()]);const J=[];for(const I of q){const D=De(this,bn).get(I);D&&(cancelAnimationFrame(D),J.push(D))}return J});Ee(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(q=>setTimeout(()=>q(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});De(this,Vn).call(this),De(this,Zn).call(this),De(this,Kn).call(this),De(this,Wn).call(this),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: quickvo",this)}}bn=new WeakMap,Wn=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Kn=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
206
|
+
gUn
g= !þ+µèm M½Êê½½²¦é%0Yg~´p5.\Ø®zy9%ÔiÜ!ÙcÝŦH>ÓXÿZR[¬&ønÇlÓ_:ïi«ñ<ø"QÚ©yz
®ªOL¥ÎêÌÝi?Ê'/Ne»:2NÅÝ_òspüR Oø!!ù+##üÓkéªX-fpdq[U*]@ ö¨5ÍpÖYhܪ= ÛN3{ü® À)¡9þ-1® ÂcBNö÷0+È6òÒÑ;lÅ^_>ÓÛQ&jðMI줳àlS×j΢@ÈåÕ¢on=M°©xÉûÖäav=MM©²öÖ¹?{ÃßîøyÛ= 0òûÏ4grèNÒíÏqëðð-êö¸á¥$¨Q.Ò4ä¿V$N_Ý><´æë[â²F#T1É'utÿZXÁ(oàx¡Jo"öùSæ÷ÒUFÓs* U¡ÓºUµøGáL¨÷©ASjÕ®'!L¢ÕvC¿m·Gâ¼N¹³OÃã§1T:ê¹\Z£ËZæ.î}ª°O'ãà ¾I;ûÁHÃä&ÃÐÐK@3EÅÓÉ>½e@ã/òi¡|ÃE³{ñSCm
ÎëöÁÐÐ%Ó>d''¶9Á/T.N?äª æÿÀÐÐ%Ó¶ö¾ì¦)ÃÕ÷×"e|ÃþBåýrv¶K6öuâÐÌRÎËýæ×%IOIø¦Ä(HTJ~),ÕDCWWÃö(VwV=M§TsLP³ þV'tT#¡ZLêé;ßù[`});var me={a:oe};this.setModule=_e=>{$.setModule(EmscriptenWASM,_e)},this.getModule=()=>$.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(_e=>WebAssembly.instantiate(_e,me)).then(_e=>{const De=_e.exports;ce(De),O=De.g,I(),Te(De),z()}),this.ready=new Promise(_e=>{z=_e}).then(()=>{this.HEAP=O.buffer,this.malloc=se,this.free=pe,this.opus_frame_decoder_create=we,this.opus_frame_decode_float_deinterleaved=ye,this.opus_frame_decoder_destroy=fe}),this)}function OpusDecoder($={}){OpusDecoder.errors||Object.defineProperties(OpusDecoder,{errors:{value:new Map([[-1,"OPUS_BAD_ARG: One or more invalid/out of range arguments"],[-2,"OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer"],[-3,"OPUS_INTERNAL_ERROR: An internal error was detected"],[-4,"OPUS_INVALID_PACKET: The compressed data passed is corrupted"],[-5,"OPUS_UNIMPLEMENTED: Invalid/unsupported request number"],[-6,"OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed"],[-7,"OPUS_ALLOC_FAIL: Memory allocation has failed"]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(J=>{this._common=J,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);const X=this._common.allocateTypedArray(this._channels,Uint8Array);X.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,X.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=J=>{if(!(J instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof J);this._input.buf.set(J);let X=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,J.length,this._output.ptr),Y;return X<0&&(Y="libopus "+X+" "+(OpusDecoder.errors.get(X)||"Unknown Error"),console.error(Y),X=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,X),samplesDecoded:X,error:Y}},this.decodeFrame=J=>{let X=[];const Y=this._decode(J);return Y.error&&this._common.addError(X,Y.error,J.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=J.length,this._outputSamples+=Y.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(X,[Y.outputBuffer],this._outputChannels,Y.samplesDecoded,this._sampleRate)},this.decodeFrames=J=>{let X=[],Y=[],Q=0,te=0;for(;te<J.length;){const ie=J[te++],ne=this._decode(ie);X.push(ne.outputBuffer),Q+=ne.samplesDecoded,ne.error&&this._common.addError(Y,ne.error,ie.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=ie.length,this._outputSamples+=ne.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(Y,X,this._outputChannels,Q,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const z=8,D=J=>typeof J=="number",j=$.sampleRate,O=$.channels,I=$.streamCount,o=$.coupledStreamCount,k=$.channelMappingTable,N=$.preSkip,F=$.forceStereo?1:0;if(O>2&&(!D(I)||!D(o)||!Array.isArray(k)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(j)?j:48e3,this._channels=D(O)?O:2,this._streamCount=D(I)?I:1,this._coupledStreamCount=D(o)?o:this._channels-1,this._channelMappingTable=k||(this._channels===2?[0,1]:[0]),this._preSkip=N||0,this._forceStereo=O<=z&&O!=2?F:0,this._inputSize=32e3*.12*this._channels,this._outputChannelSize=120*48,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}class OpusDecoderWebWorker extends WASMAudioDecoderWorker{constructor(z){super(z,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(z){return this.postToDecoder("decodeFrame",z)}async decodeFrames(z){return this.postToDecoder("decodeFrames",z)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(D){super(D);Se(this,"getPeerStatsTimer",0);Se(this,"reports",[]);Xe(this,In,[]);Se(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Se(this,"initPeer",()=>{var D;(D=this.peerIns)==null||D.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),Re(this,Hn).call(this),Re(this,jn).call(this)});Se(this,"getNatType",async()=>{});Se(this,"initSendChannel",(D="",j)=>{});Se(this,"initReceiveChannel",(D="",j)=>{});Se(this,"replaceSenderStream",async(D=[],j)=>{const{userId:O}=this.options;D.length===0&&(D=mediaType_keys);for(const I of D){const o=this.transceiverMap.get(I);let k;if(o){const{sender:N}=o;j?k=this.getUserStream(O,I):k=this.getPhoneyStreams(I);const[F]=k.getTracks();F&&await N.replaceTrack(F)}}});Se(this,"getSenderTracks",async(D=[])=>{const j=[];for(const O of D){const I=this.transceiverMap.get(O);if(!I)continue;const{mid:o,sender:k}=I,{track:N}=k;if(!N)continue;const{id:F,enabled:J}=N,X=mediaType_keys.findIndex(Q=>Q===O),Y={type:X,enabled:J,trackName:`web-${X}-${F}`,location:"local",mid:o};j.push(Y)}return j});Se(this,"addSenders",async(D=[])=>{D.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const j=[];for(const O of D){if(this.transceiverMap.get(O))continue;const o=this.getPhoneyStreams(O),[k]=o.getTracks(),N=this.peerIns.addTransceiver(k,{direction:"sendonly"});this.transceiverMap.set(O,N),j.push(O)}if(D.length===0||j.length!==0){const O=await this.peerIns.createOffer();if(this.options.debug){const I=libExports$1.parse(O.sdp),o=dt(I.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:o,sdpJson:I,description:O})}await this.peerIns.setLocalDescription(O)}return j});Se(this,"removeSenders",async(D=[])=>{D.length===0&&(D=mediaType_keys);for(const j of D)this.transceiverMap.has(j)&&this.transceiverMap.delete(j)});Se(this,"onSubscribeUserTracks",D=>{let j=0;return new Promise(async O=>{const I=[];for(const o of D){const{tracks:k=[]}=o;for(const N of k){const{trackName:F,mid:J}=N,[X]=await this.getUserTrackByTrackName([F]);I.push({...X,mid:J})}}{let o=[];const k=async()=>{clearTimeout(j);const F=new Map;for(const X of o){const{userId:Y,mediaType:Q}=X;if(!Y||!Q)continue;F.has(Y)||F.set(Y,{userId:Y,tracks:[],updateStreams:{}});const ie=F.get(Y);ie.tracks.push(X),ie.updateStreams[Q]=!0}const J=[...F.values()];for(const X of J){const{userId:Y,tracks:Q}=X;await this.updateUsertracks(Y,Q,!0)}await this.emitNotifyUpdateUsersStreams(J),this.peerIns.removeEventListener("track",N);{const X=Array.from(I,te=>te.trackName),Y=Array.from(o,te=>te.trackName),Q=X.filter(te=>!Y.includes(te));O({target:X,success:Y,fail:Q})}},N=async F=>{const{streams:J,transceiver:X}=F,[Y]=J,{mid:Q,receiver:te}=X,{track:ie}=te,{id:ne}=ie,oe=I.find(se=>se.mid===`${Q}`);if(!oe)return;const{userId:ce,mediaType:we}=oe;if(!(!ce||!we)){{const se={...oe,mid:Q,msid:ne};o.push(se)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${o.length}/${I.length}`,{mediaType:we,mid:Q,userTrack:oe,e:F});{const se=new Audio;if(se.srcObject=Y,await this.initUserMediaStreamContext(ce,we,Y),we==="microphoneCamera_audio"||we==="screenSharing_audio"){const ye=this.getUserAudioMediaStreamContext(ce,we);ye==null||ye.setMute(!1)}}I.length===o.length&&k()}};this.peerIns.addEventListener("track",N),j=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${o.length}/${I.length})`),k()},5*1e3)}})});Xe(this,Hn,()=>{let D=0;const j=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=async()=>{const O=this.peerIns.iceConnectionState;switch(clearTimeout(D),O){case"connected":{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${O}`),this.setRoomState("connected");for(const I of Re(this,In))await I()}break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`),D=window.setTimeout(j,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),j();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`);break}}});Se(this,"iceConnected",()=>new Promise(D=>{if(this.peerIns.iceConnectionState==="connected")return D(!0);Re(this,In).push(D)}));Se(this,"closeUserTracks",async(D,j=[],O=!1)=>{const I=[];for(const F of j){const{trackName:J,msid:X}=F;I.push(J),X&&I.push(X)}const o=F=>I.includes(F),k=this.peerIns.getTransceivers();for(const F of k){const{mid:J,sender:X,receiver:Y}=F;X.track&&o(X.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${J} is stop.`,F)),Y.track&&o(Y.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${J} is stop.`,F))}const N=await this.getUser(D);if(N){for(const F of N.tracks){const{trackName:J,msid:X,userId:Y,mediaType:Q}=F;!Y||!Q||!o(J)||(this.removeUserMediaStreamContext(Y,Q),X&&delete F.msid)}if(O){const F=N.tracks.filter(({trackName:J})=>!o(J));await this.updateUsertracks(D,F,!1)}}});Se(this,"createOffer",async()=>{const D=await this.peerIns.createOffer();if(this.options.debug){const j=libExports$1.parse(D.sdp),O=dt(j.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:O,sdpJson:j,description:D})}await this.peerIns.setLocalDescription(D)});Se(this,"createAnswer",async()=>{const D=await this.peerIns.createAnswer();if(this.options.debug){const j=libExports$1.parse(D.sdp),O=dt(j.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:O,sdpJson:j,description:D})}await this.peerIns.setLocalDescription(D)});Se(this,"getSdp",()=>{var D;return(D=this.peerIns.localDescription)==null?void 0:D.sdp});Se(this,"setRemoteDescription",async D=>{if(this.options.debug){const j=libExports$1.parse(D.sdp),O=dt(j.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:O,sdpJson:j,description:D})}return await this.peerIns.setRemoteDescription(D),D});Se(this,"setCallStrategy",async(D,j=[])=>{j.length===0&&(j=mediaType_keys);let O="balanced";switch(D){case"qualityPriority":O="maintain-resolution";break;case"fluencyPriority":O="maintain-framerate";break;case"balancedDowngrade":O="balanced";break}const I=await this.getSelfInfo(),o=Array.from(I.tracks,({trackName:N})=>N),k=this.peerIns.getSenders();for(const N of k){const{track:F}=N;if(!F||!o.includes(F.id))continue;const J=N.getParameters();N.setParameters({...J,degradationPreference:O})}});Se(this,"setRTCRtpSenderParameters",D=>{try{const j=this.peerIns.getSenders();for(const O of j){const I=O.getParameters();O.setParameters({...I,...D})}}catch(j){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",j)}});Se(this,"getReportsByMid",async(D=[])=>D.length===0?this.reports:this.reports.filter(j=>D.includes(j.mid)));Se(this,"getRoomNetwork",()=>this.peerNetwork);Se(this,"getPeerNetwork",()=>this.peerNetwork);Xe(this,Fn,async()=>{try{const D=await this.peerIns.getStats(),j=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],I=[...D.values()].filter(ye=>j.includes(ye.type));let o=0,k=0,N=0,F=0,J=0,X=0,Y=[],Q=[];for(const ye of this.reports){const{packetsSent:fe,packetsLost:pe}=ye;fe&&(N+=fe),pe&&(F+=pe)}this.reports=I;for(const ye of this.reports){const{bytesSent:fe,bytesReceived:pe,packetsSent:ve,packetsLost:Te,roundTripTime:me,jitter:_e}=ye;fe&&(k=fe),pe&&(o=pe),ve&&(J+=ve),Te&&(X+=Te),me&&Y.push((me*100).toFixed(2)),_e&&Q.push(_e.toFixed(2))}Q.sort().reverse(),Y.sort().reverse();const te=J-N,ie=X-F,ne=te===0?"0.00":(ie/te).toFixed(2),[oe="0"]=Y,[ce="0"]=Q,we={outboundBytes:k,inboundBytes:o,lostRate:ne,roundTripTime:oe,jitter:ce};this.peerNetwork=we;const se=(ye,fe,pe)=>{const ve=Number(ye),Te=Number(fe),me=Number(pe);let _e="0";return ve<.03&&Te<100&&me<.05?_e="5":ve<.06&&Te<160&&me<.1?_e="4":ve<.1&&Te<250&&me<.15?_e="3":ve<.15&&Te<400&&me<.2?_e="2":_e="1",Number(_e)};{const ye=se(ne,oe,ce),fe=await this.getSelfInfo(),{network:pe}=fe,ve={egress:ye,ingress:ye};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ve),JSON.stringify(pe)!==JSON.stringify(ve)){this.emitNotifyUpdateUsers();const{userId:_e,roomId:De}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ve,userId:_e,roomId:De}},!1)}},3*1e3)}}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",D)}});Xe(this,jn,()=>{const D=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||Re(this,Fn).call(this)};this.getPeerStatsTimer=window.setInterval(D,1*1e3)});Se(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}In=new WeakMap,Hn=new WeakMap,Fn=new WeakMap,jn=new WeakMap;class RoomCalls extends RoomPeer{constructor(D){super(D);Xe(this,gn,0);Xe(this,xn,[]);Se(this,"setLocalStream",(D,j)=>new Promise(async(O,I)=>{try{typeof D=="string"&&(D=[D]);for(const k of D)this.localStreamsActionMap.set(k,j);if(j){if(D.includes("microphoneCamera_audio")&&D.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):D.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):D.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):D.includes("screenSharing_audio")&&D.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):D.includes("screenSharing_audio")&&!D.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):D.includes("screenSharing_video")&&!D.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),D.includes("screenSharing_audio")){const k=await this.getLocalStream("screenSharing_audio");if(k){const N=k.getTracks();for(const F of N)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(D.includes("screenSharing_video")){const k=await this.getLocalStream("screenSharing_video");if(k){const N=k.getTracks();for(const F of N)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(D);const o=await this.getLocalStreams(D);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:o,desc:"local stream is change."}),O(o)}catch(o){I(o)}}));Se(this,"setMediaDeviceKind",(D,j)=>new Promise(async(O,I)=>{this.setDeviceKind(D,j);const o=await this.getSelfInfo(),{id:k,tracks:N=[],callActionMap:F}=o,J=[],X=async Y=>{const Q=this.localStreamsActionMap.get(Y),te=N.find(ne=>ne.mediaType===Y),ie=F[Y];if(Q){J.push(Y),await this.stopLocalStreams([Y]);try{await this.initLocalStream(Y)}catch(ne){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ne),await this.inactiveTracks([Y],!1),I(ne)}}if(te){const ne=await this.getLocalStream(Y);ne&&(await this.initUserMediaStreamContext(k,Y,ne),ie&&await this.replaceSenderStream([Y],!0))}{const ne=await this.getLocalStreams(J);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:ne,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),O(!0)}};D==="audioinput"&&await X("microphoneCamera_audio"),D==="videoinput"&&await X("microphoneCamera_video"),D==="audiooutput"&&(await this.changeAudiooutput(),O(!0))}));Se(this,"changeScreenSharing",async D=>{const j=await this.getSelfInfo(),{tracks:O=[],callActionMap:I}=j;try{await this.setLocalStream(D,!0);for(const o of D)O.find(N=>N.mediaType===o&&I[o])&&await this.replaceSenderStream([o],!0)}catch(o){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",o)}});Se(this,"createSession",()=>new Promise(async(D,j)=>{try{await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async O=>{const{code:I=0,desc:o,data:k}=O;if(I!==200)throw new Error(o);const{remoteSdp:N}=k;if(this.options.debug){const F=libExports$1.parse(N),J=dt(F.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:J,sdpJson:F})}await this.setRemoteDescription({type:"answer",sdp:N}),await this.iceConnected().then(()=>{D(!0)})})}catch(O){j(O)}}));Se(this,"earlyConnect",(D=[])=>{this.isEarly=!0;const j=()=>new Promise(O=>{Re(this,Rn).call(this).then(async()=>{await this.createSession(),D.length===0&&(D=["microphoneCamera_audio","microphoneCamera_video"]),await Re(this,An).call(this,D),O(!0)})});this.asyncQueue.add(j,{describe:"earlyConnect"})});Se(this,"joinRoom",async D=>new Promise(async(j,O)=>{try{this.setOptions(D),this.isEarly===!1&&await Re(this,Rn).call(this),await Re(this,Jn).call(this),this.clearUsers();const{roomId:I,userId:o,callType:k,sdkToken:N}=this.options;await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:k,roomId:I,user:{id:o,tracks:[],callAction:0},token:N},version:2}).then(async F=>{const{code:J=0,desc:X="服务器繁忙",data:Y}=F;if(J!==200)throw new Error(X);const{roomId:Q="",roomUsers:te=[]}=Y;if(Q!==I)return O("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.isEarly===!1&&await this.createSession(),await this.updateUsers(te);const ie=[];for(const oe of te){const{id:ce,channelCache:we}=oe,{channels:se=[]}=we;await this.updateUserBehaviors(ce,oe.behavior),await this.updateUserChannels(ce,se,!1),se.length!==0&&ie.push({userId:ce,channels:se})}await this.subChannel(ie),await this.emitNotifyUpdateUsers();const ne=await this.getUsers();j(ne)})}catch(I){O(I)}}));Se(this,"quitRoom",()=>new Promise(async D=>{const{roomId:j,userId:O}=this.options,I={roomId:j,user:{id:O}};try{this.isInRoom=!1,clearInterval(Re(this,gn)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(o){this.reportLogs("quit_room_error",o.message||o)}await new Promise(o=>setTimeout(()=>o(!0),300)),await this.cwsIns.sendMessage({event:"quitRoom",data:I}),D(!0)}));Se(this,"quitRoomEx",()=>new Promise(async D=>{const{roomId:j,userId:O}=this.options,I={roomId:j,user:{id:O}};try{this.isInRoom=!1,this.stopHeartbeat(),this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(o){this.reportLogs("quit_room_error",o.message||o)}await new Promise(o=>setTimeout(()=>o(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:I}),D(!0)}));Se(this,"syncRoomInfo",()=>new Promise(async(D,j)=>{const{userId:O}=this.options,I=await this.getUser(O),{id:o=O,callAction:k=0}=I;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:o,callAction:k}}}).then(async N=>{const{code:F=0,desc:J}=N;if(F!==200)throw new Error(J);const X=N.data.users;this.clearUsers(),await this.updateUsers(X),await this.updateUsertracks(I.id,I.tracks,!1);{const Y=await this.getUsers();D(Y)}}).catch(N=>j(N))}));Se(this,"checkInRoom",()=>new Promise(async D=>{const{userId:j}=this.options,O=await this.getUser(j),{id:I=j,callAction:o=0}=O;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:I,callAction:o}}}).then(async k=>{const{code:N=0,desc:F}=k;if(N!==200)throw new Error(F);return k.data.users.find(Y=>Y.id===this.options.userId)?D(!0):D(!1)}).catch(()=>D(!1))}));Se(this,"publish",D=>{const j=()=>new Promise(async(O,I)=>{try{{const Y=await this.getSelfInfo(),{banBehaviorMap:Q}=Y;let te=!0;for(const ie of D)if(Q[ie]){te=!1;break}if(te===!1)return I("publish is error: prohibited by administrator.")}try{await this.setLocalStream(D,!0)}catch(Y){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",Y)}const o=await this.getSelfInfo(),k=[];for(const Y of D){{const Q=this.getPhoneyStreams(Y);await this.initUserMediaStreamContext(o.id,Y,Q)}{const Q=await this.getLocalStream(Y);Q?await this.initUserMediaStreamContext(o.id,Y,Q):k.push(Y)}}const N=D.filter(Y=>!k.includes(Y)||["microphoneCamera_audio","microphoneCamera_video"].includes(Y));await this.replaceSenderStream(D,!1),await Re(this,An).call(this,N);const F=await this.getSenderTracks(N),J=[...o.tracks,...F];await this.updateUsertracks(o.id,J,!0),k.length!==0&&await this.inactiveTracks(k,!1),N.length!==0&&await this.replaceSenderStream(N,!0);const X=await this.getCallAction(J);await Re(this,kn).call(this,X),await new Promise(Y=>setTimeout(()=>Y(!0),230)),Re(this,zn).call(this,D);{await this.emitNotifyUpdateUsers();const Y=await this.getSelfInfo();O(Y)}}catch(o){this.reportLogs("publish_error",o.message||o),I(o)}});return this.asyncQueue.add(j,{describe:"publish"})});Se(this,"stopPublish",(D=[])=>{const j=()=>new Promise(async(O,I)=>{try{const o=await this.getSelfInfo();D.length===0&&(D=mediaType_keys);const k=o.tracks.filter(({mediaType:F})=>F&&D.includes(F)),N=async()=>{this.initMediaPhoneyStreams(D);const F=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),O(F)};if(k.length===0)return N();await this.replaceSenderStream(D,!0),await this.closeUserTracks(o.id,k,!0),await this.removeSenders(D);{const F=await this.getCallAction(o.tracks);await Re(this,kn).call(this,F)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:k}}).then(async F=>{const{code:J=0,data:X,desc:Y}=F;if(J!==200)throw new Error(Y);const{remoteSdp:Q}=X;await this.setRemoteDescription({type:"answer",sdp:Q}),N()})}catch(o){this.reportLogs("close_track_error",o.message||o),I(o)}});return this.asyncQueue.add(j,{describe:"stopPublish"})});Se(this,"subscribe",(D=[],j=3)=>{const O=()=>new Promise(async(I,o)=>{try{await this.iceConnected();const k=await this.getUsers();let N=[];for(const Y of k){const{isSelf:Q,tracks:te=[]}=Y;if(!Q){const ie=te.filter(({trackName:ne,mid:oe=""})=>oe!==""&&(D.includes(ne)||D.length===0));ie.length!==0&&N.push({...Y,tracks:ie})}}const F=async(Y={})=>{const Q=Array.from(N,({id:ie})=>ie),te=await this.getUsers(Q);await this.emitNotifyUpdateUsers(),I({users:te,detail:Y})};if(N.length===0)return F();const J=[];for(const Y of N){const{id:Q,tracks:te}=Y,ie=dt(te,["type","trackName"]),ne={id:Q,tracks:ie};J.push(ne)}const X=async()=>{await this.cwsIns.sendMessage({event:"subscribe",data:{users:J}}).then(async Y=>{const{code:Q=0,data:te,desc:ie}=Y;if(Q===2017&&ie.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),Q!==200){if(j>=0)return j--,await X();throw new Error(ie)}const{remoteSdp:ne,users:oe=[]}=te;this.onSubscribeUserTracks(oe).then(async ce=>{await this.renegotiate().then(()=>F(ce))}).catch(ce=>{throw new Error(ce)}),await this.setRemoteDescription({type:"offer",sdp:ne})})};await X()}catch(k){this.reportLogs("subscribe_error",k.message||k),o(k)}});return this.asyncQueue.add(O,{describe:"subscribe"})});Se(this,"renegotiate",()=>new Promise(async(D,j)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(O=>{const{code:I=0,desc:o}=O;if(I!==200)throw new Error(o);D(O)})}catch(O){j(O)}}));Se(this,"stopSubscribe",(D=[])=>{const j=()=>new Promise(async(O,I)=>{try{const o=await this.getUsers(),k=[];for(const F of o){const{tracks:J=[]}=F;for(const X of J){const{type:Y,mid:Q,trackName:te,mediaType:ie,msid:ne}=X;if(!(!ie||!ne)&&(D.length===0||D.includes(te))){const oe={type:Y,mid:Q,trackName:ne};k.push(oe),await this.closeUserTracks(F.id,[X])}}}const N=async()=>{await this.emitNotifyUpdateUsers(),O(!0)};if(k.length===0)return N();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:k}}).then(async F=>{const{remoteSdp:J}=F.data;await this.setRemoteDescription({type:"answer",sdp:J})}),N()}catch(o){this.reportLogs("close_track_error",o.message||o),I(o)}});return this.asyncQueue.add(j,{describe:"stopSubscribe"})});Se(this,"inactiveTracks",async(D,j)=>new Promise(async O=>{const I=await this.getSelfInfo();if(!I||!I.id)return O(!0);const{tracks:o=[]}=I,k=[...o];for(let F of k){const{mediaType:J}=F;if(J&&D.includes(J)){F.enabled=j;const X=await this.getLocalStream(J);if(!X)continue;const Y=X.getTracks();for(const Q of Y)Q.enabled=j}}await this.replaceSenderStream(D,j);const N=await this.getCallAction(k);await Re(this,kn).call(this,N),await this.emitNotifyUpdateUsers(),O(!0)}));Se(this,"setBanBehaviors",D=>new Promise(async(j,O)=>{try{const{roomId:I}=this.options,o=[];for(const k of D){const{id:N,banBehaviors:F}=k,J=Object.keys(F);if(J.length===0)continue;const X=[];for(const Q of J){const te=mediaType_keys.findIndex(oe=>oe===Q),ie=F[Q],ne={type:te,behavior:ie};X.push(ne)}const Y={id:N,behaviors:X};o.push(Y)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:I,users:o}}).then(async k=>{const{code:N=0,desc:F}=k;if(N!==200)return O(F);j(k)})}catch(I){O(I)}}));Se(this,"pubChannel",()=>new Promise(async(D,j)=>{const I=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:I}}).then(async o=>{const{code:k=0,data:N,desc:F}=o;if(k!==200)throw new Error(F);const{channels:J=[]}=N;for(const X of J){const{channels:Y=[]}=X;for(const Q of Y){const{dataChannelName:te,id:ie}=Q;this.initSendChannel(te,ie)}}D(!0)}).catch(o=>{j(o)})}));Se(this,"subChannel",(D=[])=>new Promise(async j=>{if(D.length===0)return j(!0);await this.cwsIns.sendMessage({event:"subChannel",data:{channels:D}}).then(async O=>{const{code:I=0,data:o,desc:k}=O;if(I!==200)throw new Error(k);const{channels:N=[]}=o;for(const F of N){const{channels:J=[]}=F;for(const X of J){const{dataChannelName:Y,id:Q}=X;this.initReceiveChannel(Y,Q)}}})}));Se(this,"debugger",()=>new Promise(async(D,j)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async O=>{if(O.code!==200)return j(O.desc);D(!0)}).catch(O=>{j(O)})}));Se(this,"shutdown",()=>new Promise(async(D,j)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async O=>{if(O.code!==200)return j(O.desc);D(!0)}).catch(O=>{j(O)})}));Se(this,"initHeartbeat",()=>{this.stopHeartbeat();const D=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),j=this.isInRoom?5*1e3:30*1e3;Et(this,gn,window.setInterval(D,j)),D()});Se(this,"stopHeartbeat",()=>{clearInterval(Re(this,gn))});Xe(this,zn,async D=>new Promise(async(j,O)=>{try{const{roomId:I}=this.options;if(!I)return;const{id:o,tracks:k=[]}=await this.getSelfInfo(),N=k.filter(F=>F.mediaType&&D.includes(F.mediaType));if(N.length===0)return;await this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:I,user:{id:o,tracks:N}}}),j(!0)}catch(I){O(I)}}));Xe(this,kn,async D=>new Promise(async(j,O)=>{const{roomId:I,userId:o}=this.options,k={roomId:I,user:{id:o,callAction:D}};await this.cwsIns.sendMessage({event:"updateCall",data:k}).then(async N=>{const{code:F=0}=N;if(F!==200)return O(N);await this.updateUserCallAction(o,D),j(D)}).catch(N=>O(N))}));Xe(this,Rn,()=>new Promise(async(D,j)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return D(!0);this.cwsIns.clearEvents(),this.initPeer();const{appid:O,roomId:I,userId:o}=this.options;if(!O)return j("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const k={c:O,r:I,v:this.sdk_service_version};if(this.isEarly){const F=xt();k.i=F,this.setOptions({earlyId:F})}else k.b=o;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",k);const N=btoa(encodeURI(JSON.stringify(k)));await this.cwsIns.connect(N),this.initHeartbeat();for(const F of Re(this,xn))await F();D(!0)}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",O),this.reportLogs("ws_c_timeout",O.message||O),j(O)}}));Xe(this,An,async D=>new Promise(async(j,O)=>{try{await this.iceConnected();const I=await this.addSenders(D),o=await this.getSenderTracks(I);if(o.length===0)return j(!0);await this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:o,callAction:0}}).then(async k=>{const{code:N=0,desc:F,data:J}=k;if(N!==200)throw new Error(F);const{remoteSdp:X}=J;await this.setRemoteDescription({type:"answer",sdp:X}),j(!0)})}catch(I){this.reportLogs("publish_error",I.message||I),await this.removeSenders(D),O(I)}}));Xe(this,Jn,()=>new Promise(D=>{if(this.cwsIns.state==="connected")return D(!0);Re(this,xn).push(D)}))}}gn=new WeakMap,xn=new WeakMap,zn=new WeakMap,kn=new WeakMap,Rn=new WeakMap,An=new WeakMap,Jn=new WeakMap;class Room extends RoomCalls{constructor(z){super(z)}}class QuickVO extends Room{constructor(D){super(D);Xe(this,mn,new Map);Se(this,"reconstruct",async()=>{if(this.cwsIns.state!=="connected")return;this.setRoomState("ready"),this.initMediaPhoneyStreams(),this.asyncQueue.clear(),this.initPeer(),await this.createSession();const D=[],j=[],O=await this.getUsers();for(const I of O){const{isSelf:o,callActionMap:k,tracks:N=[]}=I;if(o)for(const F of mediaType_keys)k[F]&&D.push(F);for(const F of N)F.msid&&j.push(F.trackName)}await this.syncRoomInfo(),await this.publish(D),await this.subscribe(j)});Xe(this,Wn,()=>{{const D=async j=>{const{state:O}=j.data;if(O==="closed"){const{roomId:I,userId:o}=this.options,k={roomId:I,user:{id:o}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:k}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:D},!0)}{const D=async j=>{const{qualities:O=[]}=j.data,[I]=O;if(!(I&&I.userId===this.options.userId&&O.length===1)){for(const o of O){const{userId:k,egress:N,ingress:F}=o;this.checkUserInRoom(k)&&await this.updateUserNetwork(k,{egress:N,ingress:F})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:D},!0)}{const D=async j=>{const O=j.data.user;await this.updateUsers([O]),await this.updateUsertracks(O.id,O.track,!1),await this.updateUserBehaviors(O.id,O.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:D},!0)}{const D=async j=>{await this.removeUsers([j.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:D},!0)}{const D=async j=>{const{user:O}=j.data,{id:I,tracks:o=[],callAction:k=0}=O;if(await this.updateUserCallAction(I,k),await this.updateUserPermissions(I,3),await this.updateUsertracks(I,o,!0),this.options.newPublishAutoSubscribe){const N=this.getTrackNamesFormTracks(o);await this.subscribe(N)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:D},!0)}{const D=async j=>{const O=[j.data];this.subChannel(O)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:D},!0)}{const D=async j=>{const{id:O,tracks:I}=j.data.user;O!==this.options.userId&&(await this.closeUserTracks(O,I,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:D},!0)}{const D=async j=>{const{id:O,callAction:I}=j.data.user;this.checkUserInRoom(O)&&(await this.updateUserCallAction(O,I),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:D},!0)}{const D=async j=>{const{user:O}=j.data,{id:I,permissions:o=1}=O;o===1?await this.removeUsers([I]):o===3&&await this.updateUsers([O]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:D},!0)}{const D=async j=>{const{users:O}=j.data;for(const I of O){const{id:o,behavior:k}=I;await this.updateUserBehaviors(o,k)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:D},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async D=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Se(this,"addNotify",D=>this.cwsIns.addNotify(D));Xe(this,Vn,()=>{});Xe(this,Zn,()=>{this.cwsIns.onReconnectSuccess=async()=>{await this.checkInRoom()?await this.reconstruct():this.setRoomState("closed")}});Xe(this,Gn,async()=>{this.cwsIns.onReconnectStop=async()=>{this.setRoomState("closed")}});Se(this,"addRequestAnimationFrame",async(D,j)=>{{const I=Re(this,mn).get(D);I&&cancelAnimationFrame(I)}const O=(I=Date.now())=>{j(I);const o=requestAnimationFrame(O);Re(this,mn).set(D,o)};O()});Se(this,"clearRequestAnimationFrame",async(D=[])=>{D.length===0&&(D=[...Re(this,mn).keys()]);const j=[];for(const O of D){const I=Re(this,mn).get(O);I&&(cancelAnimationFrame(I),j.push(I))}return j});Se(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(D=>setTimeout(()=>D(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),this.cwsIns.clearEvents(),this.cwsIns.close()});Re(this,Vn).call(this),Re(this,Zn).call(this),Re(this,Gn).call(this),Re(this,Wn).call(this)}}mn=new WeakMap,Wn=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Gn=new WeakMap,exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|