quickvo-player 0.0.4 → 0.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 CHANGED
@@ -1,71 +1,84 @@
1
- var U = Object.defineProperty;
2
- var D = (f) => {
3
- throw TypeError(f);
1
+ var Z = Object.defineProperty;
2
+ var X = (h) => {
3
+ throw TypeError(h);
4
4
  };
5
- var W = (f, o, u) => o in f ? U(f, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[o] = u;
6
- var v = (f, o, u) => W(f, typeof o != "symbol" ? o + "" : o, u), B = (f, o, u) => o.has(f) || D("Cannot " + u);
7
- var x = (f, o, u) => (B(f, o, "read from private field"), u ? u.call(f) : o.get(f)), P = (f, o, u) => o.has(f) ? D("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(f) : o.set(f, u), C = (f, o, u, c) => (B(f, o, "write to private field"), c ? c.call(f, u) : o.set(f, u), u);
8
- const L = '(function(){"use strict";const U=new TextDecoder("utf-8"),H=(e,s)=>{const a=e.getUint8(s),t=a>>7&1,n=a>>5&3,r=a&31;return{forbidden_zero_bit:t,nal_ref_idc:n,nal_unit_type:r}},b=(e,s)=>e.getUint8(s),P=(e,s,a)=>{const t=new Uint8Array(e.buffer.slice(s,s+a));return U?.decode(t)||""},T=(e,s,a)=>{let t=s,n,r=0;switch(a){case 0:n=e.getFloat64(t,!1),r=8;break;case 1:n=!!e.getUint8(t),r=1;break;case 2:{n="";const o=e.getUint16(t,!1);t=t+2;const c=new Int8Array(e.buffer,t,o).filter(d=>d!==0);n=(U?.decode(c)||"").trim(),r=2+o}break;case 3:for(n={};t<e.byteLength;){const o=e.getUint16(t,!1);if(o===0)break;t=t+2;const c=P(e,t,o);t=t+o;const g=b(e,t);if(g===6)break;t=t+1;const d=T(e,t,g);t=t+d.length,n[c]=d.value,r=2+o+1+d.length}break;case 8:{n={};const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=e.getUint16(t,!1);t=t+2;const d=P(e,t,g);t=t+g;const h=b(e,t);t=t+1;const l=T(e,t,h);t=t+l.length,n[d]=l.value,r=2+g+1+l.length}}break;case 10:{n=[];const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=b(e,t);t=t+1;const d=T(e,t,g);t=t+d.length,n.push(d.value),r=1+d.length}}break}return{amfType:a,length:r,value:n}},m=(e,s)=>e.getUint8(s)<<16|e.getUint8(s+1)<<8|e.getUint8(s+2);var u={header:{getSignature:e=>{const s=new Int8Array(e.buffer.slice(0,3));return U?.decode(s)||""},getVersion:e=>e.getUint8(3),getFlags:e=>{const a=e.getUint8(0).toString(2).padStart(5,"0").split(""),[,,t,,n]=a;return{audio:n==="1",video:t==="1"}},getDataOffset:e=>e.getUint32(5)},getPreviousTagSize:(e,s)=>e.getUint32(s),isSurplusTag:(e,s)=>{let a=!0;const t=e.byteLength;if(s+4>t)a=!1;else if(s+4+11>t)a=!1;else{const n=m(e,s+4+1);s+4+11+n>t&&(a=!1)}return a},tag:{tagHeader:{getTagType:(e,s)=>{const a=e.getUint8(s);let t;switch(a){case 18:t="script";break;case 8:t="audio";break;case 9:t="video";break}return t},getDataSize:(e,s)=>m(e,s+1),getTimestamp:(e,s)=>m(e,s+4),getTimestampExtended:(e,s)=>e.getUint8(s+7),getStreamID:(e,s)=>m(e,s+8)},tagBody:{parseAudio:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n>>2&3,o=n>>1&1,c=n&1;t=t+1;const g=e.getUint8(t);t=t+1;const d=a-2,h=new Uint8Array(e.buffer.slice(t,t+d));if(r===10&&g===0){const l=e.getUint8(t),p=e.getUint8(t+1),f=(l&248)>>3,y=(l&7)<<1|p>>7,S=(p&120)>>3,A=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],D=`mp4a.40.${f}`,z=A[y];return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h,audioObjectType:f,samplingFrequencyIndex:y,channelConfiguration:S,codec:D,sampleRate:z}}return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h}},parseVideo:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n&15;t=t+1;const o=e.getUint8(t);t=t+1;const c=m(e,t);t=t+3;const g=a-5,d=new Uint8Array(e.buffer.slice(t,t+g));switch(i){case 7:if(o===0){const h=e.getUint8(t);if(t=t+1,h!==1)throw new Error("Invalid AVC version");const l=e.getUint8(t)&255;t=t+1;const p=e.getUint8(t)&255;t=t+1;const f=e.getUint8(t)&255;t=t+1;const A=`avc1.${Array.from([l,p,f],E=>E.toString(16).padStart(2,"0")).join("")}`,D=(e.getUint8(t)&3)-1;t=t+1;const z=e.getUint8(t)&31;t=t+1;const _=e.getUint16(t,!1);t=t+2;const O=new Uint8Array(e.buffer.slice(t,t+_));t=t+_;const I=e.getUint8(t)&31;t=t+1;const x=e.getUint16(t,!1);t=t+2;const M=new Uint8Array(e.buffer.slice(t,t+x));return t=t+x,{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,version:h,codec:A,profile:l,compatibility:p,level:f,lengthSizeMinusOne:D,numOfSequenceParameterSets:z,sequenceParameterSetLength:_,sps:O,numOfPictureParameterSets:I,pictureParameterSetLength:x,pps:M}}else if(o===1){const h=[],l=t+a-5;for(;t+4<l;){const p=e.getUint32(t,!1);t=t+4;const f=H(e,t);t=t+1;const y=p-1,S=new Uint8Array(e.buffer.slice(t,t+y));t=t+y,h.push({size:p,header:f,payload:S})}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,nalus:h}}break;default:throw new Error("Unsupported codecID")}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d}},parseMetaData:(e,s)=>{let a=s;{if(e.getUint8(a)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");a=a+1}const t=e.getUint16(a,!1);a=a+2;{const i=new Int8Array(e.buffer.slice(a,a+t));if((U?.decode(i)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");a=a+t}const n=b(e,a);return a=a+1,T(e,a,n).value}}}};class L{parseSpeed=8;pendingPayloads=[];payload=new Uint8Array(0);offset=0;is_parsing=!1;header;tag;on={};constructor(){}init=()=>{this.destroy()};push=s=>{this.pendingPayloads.push(s),this.is_parsing||this.parse()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.offset=0,this.is_parsing=!1,this.header=void 0,this.tag=void 0};parse=async()=>{for(this.is_parsing=!0;;){const s=this.pendingPayloads.shift();if(!s)break;const a=new Uint8Array(this.payload.byteLength+s.byteLength);a.set(this.payload,0),a.set(s,this.payload.byteLength),this.payload=a;const t=new DataView(this.payload.buffer);this.header||this.parseHeader(t),await this.parseTag(t)}this.is_parsing=!1};parseHeader=s=>(this.header={signature:u.header.getSignature(s),version:u.header.getVersion(s),flags:u.header.getFlags(s),dataOffset:u.header.getDataOffset(s)},this.offset=this.header?.dataOffset,this.on.header&&this.on.header(this.header),this.header);parseTag=async s=>{const a=(n,r)=>({tagType:u.tag.tagHeader.getTagType(n,r),dataSize:u.tag.tagHeader.getDataSize(n,r),timestamp:u.tag.tagHeader.getTimestamp(n,r),timestampExtended:u.tag.tagHeader.getTimestampExtended(n,r),streamID:u.tag.tagHeader.getStreamID(n,r)}),t=(n,r,i,o)=>{let c;switch(n){case"script":c=u.tag.tagBody.parseMetaData(r,i);break;case"audio":c=u.tag.tagBody.parseAudio(r,i,o);break;case"video":c=u.tag.tagBody.parseVideo(r,i,o);break}return c};for(;this.offset<s.byteLength;){if(u.isSurplusTag(s,this.offset)===!1){this.payload=this.payload.slice(this.offset),this.offset=0;break}const r=a(s,this.offset+4),{tagType:i,dataSize:o}=r;if(!i)break;const c=t(i,s,this.offset+4+11,o);this.tag={header:r,body:c},this.on.tag&&this.on.tag(this.tag),this.offset=this.offset+4+11+o,await new Promise(g=>setTimeout(()=>g(!0),this.parseSpeed))}}}const k=new L;k.on.header=e=>postMessage({action:"onHeader",data:e}),k.on.tag=e=>postMessage({action:"onTag",data:e}),onmessage=e=>{const{action:s,data:a}=e.data,t=k[s];t&&t(a)}})();\n', A = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", L], { type: "text/javascript;charset=utf-8" });
9
- function E(f) {
5
+ var tt = (h, o, a) => o in h ? Z(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a;
6
+ var m = (h, o, a) => tt(h, typeof o != "symbol" ? o + "" : o, a), Q = (h, o, a) => o.has(h) || X("Cannot " + a);
7
+ var U = (h, o, a) => (Q(h, o, "read from private field"), a ? a.call(h) : o.get(h)), J = (h, o, a) => o.has(h) ? X("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(h) : o.set(h, a), K = (h, o, a, u) => (Q(h, o, "write to private field"), u ? u.call(h, a) : o.set(h, a), a);
8
+ const D = '(function(){"use strict";class P{pendingPayloads=[];payload=new Uint8Array(0);chunks=[];push=t=>{this.pendingPayloads.push(t)};next=(t=0)=>{this.payload=this.payload.slice(t);const s=this.pendingPayloads.shift();if(!s)return!1;const e=new Uint8Array(this.payload.byteLength+s.byteLength);return e.set(this.payload,0),e.set(s,this.payload.byteLength),this.payload=e,new DataView(this.payload.buffer)};pushChunk=t=>{this.chunks.push(t),this.chunks.length>1e3&&this.chunks.shift()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.chunks=[]}}const I=(u,t)=>{const s=new Uint8Array(u),e=new Uint8Array(t),n=new Uint8Array(11+s.length+e.length);let a=0;return n[a++]=1,n[a++]=s[1],n[a++]=s[2],n[a++]=s[3],n[a++]=255,n[a++]=225,n[a++]=s.length>>8&255,n[a++]=s.length&255,n.set(s,a),a+=s.length,n[a++]=1,n[a++]=e.length>>8&255,n[a++]=e.length&255,n.set(e,a),n},T=u=>{let t=0;const s=new DataView(u.buffer),e=s.getUint8(t);if(t=t+1,e!==1)throw new Error("Invalid AVC version");const n=s.getUint8(t)&255;t=t+1;const a=s.getUint8(t)&255;t=t+1;const i=s.getUint8(t)&255;t=t+1;const h=`avc1.${Array.from([n,a,i],b=>b.toString(16).padStart(2,"0")).join("")}`,c=(s.getUint8(t)&3)-1;t=t+1;const g=s.getUint8(t)&31;t=t+1;const p=s.getUint16(t,!1);t=t+2;const l=new Uint8Array(s.buffer.slice(t,t+p));t=t+p;const d=s.getUint8(t)&31;t=t+1;const f=s.getUint16(t,!1);t=t+2;const y=new Uint8Array(s.buffer.slice(t,t+f));return t=t+f,{version:e,codec:h,profile:n,compatibility:a,level:i,lengthSizeMinusOne:c,numOfSequenceParameterSets:g,sequenceParameterSetLength:p,sps:l,numOfPictureParameterSets:d,pictureParameterSetLength:f,pps:y}},M=u=>{const t=new Uint8Array(4+u.length);return new DataView(t.buffer).setUint32(0,u.length,!1),t.set(u,4),t},C=u=>{let t=0;for(const n of u)t+=n.length;const s=new Uint8Array(t);let e=0;for(const n of u){const a=n;s.set(a,e),e+=a.length}return s},x=u=>{let t="unknown";switch(u){case 1:case 2:case 27:case 36:t="video";break;case 3:case 4:case 15:t="audio";break;case 6:t="subtitle";break;case 134:t="ad";break}return t};class D{pat;pmt;audioConfig;videoConfig;payloadMap=new Map;on={};constructor(){}parse=async t=>{let s=0;for(;!(s+188>t.byteLength);){if(t.getInt8(s)!=71){s++;continue}await this.parsePacket(t,s),s+=188}return s};parsePacket=async(t,s)=>{if(s+188>t.byteLength)throw new Error("Invalid TS packet");if(t.getUint8(s)!==71)throw new Error("Invalid TS packet");let e=s;const n=this.parseHeader(t,e);e+=4;const{transport_error_indicator:a,pid:i,payload_unit_start_indicator:o,adaptation_field_control:r}=n;if(a===1||i===void 0)return;let h=184;if(r===2||r===3){const c=t.getUint8(e);e+=1,this.parseAdaptationField(t,e),e+=c,h-=c}if(r===3&&(h-=1),r===1||r===3){const c=new Uint8Array(t.buffer.slice(e,e+h));if(i===0)return this.parsePAT(t,e);{const{programs:l=[]}=this.pat||{};if(l.find(f=>f.pmt_pid===i))return this.parsePMT(t,e)}const{streams:g=[]}=this.pmt||{},p=g.find(l=>l.elementary_pid===i);if(p){if(o===1){const l=this.payloadMap.get(i);if(l){switch(p.kind){case"audio":break;case"video":{const d=await this.parseVideo(l);this.on.chunk&&this.on.chunk(d),await new Promise(f=>setTimeout(()=>f(!0),8))}break}this.payloadMap.delete(i)}}{this.payloadMap.has(i)||this.payloadMap.set(i,new Uint8Array);const l=this.payloadMap.get(i),d=new Uint8Array(l.byteLength+c.byteLength);d.set(l,0),d.set(c,l.byteLength),this.payloadMap.set(i,d)}}}};parseHeader=(t,s)=>{let e=s;const n=t.getUint8(e),a=t.getUint8(e+1),i=t.getUint8(e+2),o=t.getUint8(e+3),r=(a&128)>>7;if(r===1)return{sync_byte:n,transport_error_indicator:r};const h=(a&64)>>6,c=(a&32)>>5,g=(a&31)<<8|i,p=(o&192)>>6,l=o>>4&3,d=o&15;return{sync_byte:n,transport_error_indicator:r,payload_unit_start_indicator:h,transport_priority:c,pid:g,transport_scrambling_control:p,adaptation_field_control:l,continuity_counter:d}};parsePAT=(t,s)=>{let e=s,n;{const o=t.getUint8(e);e+=1;const r=t.getUint8(e);if(e+=1,r!==0)throw new Error("Invalid PAT table_id");const h=t.getUint16(e)&4095;e+=2;const c=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const l=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1,n={pointer_field:o,table_id:r,section_length:h,transport_stream_id:c,version_number:g,current_next_indicator:p,section_number:l,last_section_number:d}}const a=[];{const o=n.section_length-5-4,r=e+o;for(;e<r;){const h=t.getUint16(e),c=t.getUint16(e+2)&8191;e+=4,h!==0&&c>=32&&c<=8190&&a.push({program_number:h,pmt_pid:c})}}const i=t.getUint32(e);this.pat={header:n,programs:a,crc32:i},this.on.debug&&this.on.debug({pat:this.pat})};parsePMT=(t,s)=>{let e=s,n;{const o=t.getUint8(e);e+=1;const r=t.getUint8(e);if(e+=1,r!==2)throw new Error("Invalid PMT table_id");const h=t.getUint16(e)&4095;e+=2;const c=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const l=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1;const f=t.getUint16(e)&8191;e+=2;const y=t.getUint16(e)&4095;e+=2,n={pointer_field:o,table_id:r,section_length:h,transport_stream_id:c,version_number:g,current_next_indicator:p,section_number:l,last_section_number:d,pcr_pid:f,program_info_length:y}}const a=[];{const o=n.section_length-9-4,r=e+o;for(;e<r;){const h=t.getUint8(e),c=x(h),g=t.getUint16(e+1)&8191,p=t.getUint16(e+3)&4095;if(e+=5,g<32||g>8190){console.warn(`Invalid elementary_pid: 0x${g.toString(16)}`);continue}a.push({kind:c,stream_type:h,elementary_pid:g,es_info_length:p})}}const i=t.getUint32(e);this.pmt={header:n,streams:a,crc32:i},this.on.debug&&this.on.debug({pmt:this.pmt})};parseAdaptationField=(t,s)=>{let e=s,n,a,i,o;const r=t.getUint8(e),h=!!(r&128),c=!!(r&64),g=!!(r&32),p=!!(r&16),l=!!(r&8),d=!!(r&4),f=!!(r&2),y=!!(r&1);e+=1;const b=(U,m)=>{let _=BigInt(0);_|=BigInt(U.getUint16(m))<<25n,_|=BigInt(U.getUint16(m+1))<<17n,_|=BigInt(U.getUint16(m+2))<<9n,_|=BigInt(U.getUint16(m+3))<<1n,_|=BigInt(U.getUint16(m+4)>>7);const B=(U.getUint16(m+4)&1)<<8|U.getUint16(m+5);return _=_*300n+BigInt(B),_};if(p&&(n=b(t,e),e+=6),l&&(a=b(t,e),e+=6),d&&(i=t.getInt8(e),e+=1),f){const U=t.getUint8(e);e+=1,o=new Uint8Array(t.buffer,e,U),e+=U}return{discontinuity_indicator:h,random_access_indicator:c,elementary_stream_priority_indicator:g,pcr_flag:p,opcr_flag:l,splicing_point_flag:d,transport_private_data_flag:f,adaptation_field_extension_flag:y,pcr:n,opcr:a,splice_countdown:i,transport_private_data:o}};parseVideo=async t=>{const s=new DataView(t.buffer);let e=0,n,a;{const i=s.getUint8(e)===0&&s.getUint8(e+1)===0&&s.getUint8(e+2)===1;if(e+=3,!i)throw new Error("invalid ts video payload.");const o=s.getUint8(e);e+=1;const r=s.getUint8(e)<<8|s.getUint8(e+1);e+=2;let h,c;const g=o!==188&&o!==190&&o!==191&&o!==240&&o!==241&&o!==255&&o!==242;if(g){e+=1;const p=s.getUint8(e);e+=1;const l=p>>6,d=s.getUint8(e);e+=1,(l&2)===2&&(h=this.parsePtsDts(s,e),e+=5),(l&1)===1?(c=this.parsePtsDts(s,e),e+=5):c=h,e+=d-(e-9)}n={stream_id:o,pes_packet_length:r,pts:h,dts:c,optional_header_exist:g}}a=t.slice(e);{const i=this.getNalus(a);if(!this.videoConfig){let l,d;if(l=i.find(y=>y.type===7)?.nalu.slice(4),d=i.find(y=>y.type===8)?.nalu.slice(4),l&&d){const f=I(l,d),{codec:y}=T(f);this.videoConfig={kind:"video",codec:y,description:f,sps:l,pps:d},this.on.config&&this.on.config(this.videoConfig)}}const o=[];let r="delta";for(const l of i){const{type:d,nalu:f}=l;switch(d){case 6:case 9:o.push(f);break;case 1:r="delta",o.push(f);break;case 5:r="key",o.push(f);break}}const h=C(o),{dts:c=0,pts:g=0}=n,p=g-c;return{kind:"video",type:r,dts:c,pts:g,cts:p,data:h,nalus:o}}};parsePtsDts(t,s){const e=t.getUint8(s),n=t.getUint8(s+1),a=t.getUint8(s+2),i=t.getUint8(s+3),o=t.getUint8(s+4),r=(BigInt(e)&0b00001110n)<<29n|(BigInt(n)&0b11111111n)<<22n|(BigInt(a)&0b11111110n)<<14n|(BigInt(i)&0b11111111n)<<7n|(BigInt(o)&0b11111110n)>>1n;return Number(r)/90}getNalus=t=>{const s=[];let e=0;for(;!(e+4>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}e+=3;let n=e;const a=t[e]&31;for(e+=1;!(e+1>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}break}let i=e-n;if(t[e-1]===0&&(i-=1),i!==0){const o=t.slice(n,n+i),r=M(o);s.push({type:a,nalu:r})}}return s}}const k=(u,t)=>u.getUint8(t)<<16|u.getUint8(t+1)<<8|u.getUint8(t+2);class L{audioConfig;videoConfig;header;textDecoder=new TextDecoder("utf-8");on={};constructor(){}parse=async t=>{let s=0;for(this.header||(this.parseHeader(t,s),s+=9);this.isSurplusTag(t,s)!==!1;){const n=this.parseTagHeader(t,s+4),{tagType:a,dataSize:i,timestamp:o}=n;if(a){const r=this.parseTagBody(a,t,s+4+11,i);switch(a){case"script":this.on.info&&this.on.info(r);break;case"audio":{const{accPacketType:h}=r;if(h===0){const{codec:c,sampleRate:g,channelConfiguration:p}=r;this.audioConfig={kind:"audio",codec:c,sampleRate:g,numberOfChannels:p},this.on.config&&this.on.config(this.audioConfig)}else{const{cts:c,data:g}=r,p="key",l=c===void 0?void 0:c+o;this.on.chunk&&this.on.chunk({kind:"audio",type:p,dts:o,pts:l,cts:c,data:g})}}break;case"video":{const{avcPacketType:h}=r;if(h===0){const{codec:c,sps:g,pps:p,data:l}=r;this.videoConfig={kind:"video",codec:c,description:l,sps:g,pps:p},this.on.config&&this.on.config(this.videoConfig)}else{const{frameType:c,cts:g,data:p,nalus:l}=r,d=c===1?"key":"delta",f=g===void 0?void 0:g+o;this.on.chunk&&this.on.chunk({kind:"video",type:d,dts:o,pts:f,cts:g,data:p,nalus:l})}}break}s=s+4+11+i}await new Promise(r=>setTimeout(()=>r(!0),8))}return s};parseHeader=(t,s)=>{let e,n,a,i;e=t.getUint8(s)<<16|t.getUint8(s+1)<<8|t.getUint8(s+2),n=t.getUint8(3);{const r=t.getUint8(0).toString(2).padStart(5,"0").split(""),[,,h,,c]=r;a={audio:c==="1",video:h==="1"}}i=t.getUint32(5),this.header={signature:e,version:n,flags:a,dataOffset:i}};isSurplusTag=(t,s)=>{let e=!0;const n=t.byteLength;if(s+4>n)e=!1;else if(s+4+11>n)e=!1;else{const a=k(t,s+4+1);s+4+11+a>n&&(e=!1)}return e};parseTagHeader=(t,s)=>{let e,n,a,i,o;{const r=t.getUint8(s);let h;switch(r){case 18:h="script";break;case 8:h="audio";break;case 9:h="video";break}e=h}return n=k(t,s+1),a=k(t,s+4),i=t.getUint8(s+7),o=k(t,s+8),{tagType:e,dataSize:n,timestamp:a,timestampExtended:i,streamID:o}};parseTagBody=(t,s,e,n)=>{let a;switch(t){case"script":a=this.parseMetaData(s,e);break;case"audio":a=this.parseAudio(s,e,n);break;case"video":a=this.parseVideo(s,e,n);break}return a};parseMetaData=(t,s)=>{let e=s;{if(t.getUint8(e)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");e=e+1}const n=t.getUint16(e,!1);e=e+2;{const o=new Int8Array(t.buffer.slice(e,e+n));if((this.textDecoder?.decode(o)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");e=e+n}const a=this.getAmfType(t,e);return e=e+1,this.getAMFValue(t,e,a).value};parseAudio=(t,s,e)=>{let n=s;const a=t.getUint8(n),i=a>>4&15,o=a>>2&3,r=a>>1&1,h=a&1;n=n+1;const c=t.getUint8(n);n=n+1;const g=e-2,p=new Uint8Array(t.buffer.slice(n,n+g));if(i===10&&c===0){const l=t.getUint8(n),d=t.getUint8(n+1),f=(l&248)>>3,y=(l&7)<<1|d>>7,b=(d&120)>>3,U=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],m=`mp4a.40.${f}`,_=U[y];return{soundFormat:i,soundRate:o,soundSize:r,soundType:h,accPacketType:c,data:p,audioObjectType:f,samplingFrequencyIndex:y,channelConfiguration:b,codec:m,sampleRate:_}}return{soundFormat:i,soundRate:o,soundSize:r,soundType:h,accPacketType:c,data:p}};parseVideo=(t,s,e)=>{let n=s;const a=t.getUint8(n),i=a>>4&15,o=a&15;n=n+1;const r=t.getUint8(n);n=n+1;const h=k(t,n);n=n+3;const c=e-5,g=new Uint8Array(t.buffer.slice(n,n+c));switch(o){case 7:if(r===0){const p=T(g);return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g,...p}}else if(r===1){const p=[],l=n+e-5;for(;!(n+4>l);){const d=t.getUint32(n,!1),f=new Uint8Array(t.buffer.slice(n,n+4+d));n+=4+d,p.push(f)}return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g,nalus:p}}break;default:throw new Error("Unsupported codecID")}return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g}};getAmfType=(t,s)=>t.getUint8(s);getAMFName=(t,s,e)=>{const n=new Uint8Array(t.buffer.slice(s,s+e));return this.textDecoder?.decode(n)||""};getAMFValue=(t,s,e)=>{let n=s,a,i=0;switch(e){case 0:a=t.getFloat64(n,!1),i=8;break;case 1:a=!!t.getUint8(n),i=1;break;case 2:{a="";const r=t.getUint16(n,!1);n=n+2;const h=new Int8Array(t.buffer,n,r).filter(g=>g!==0);a=(this.textDecoder?.decode(h)||"").trim(),i=2+r}break;case 3:for(a={};n<t.byteLength;){const r=t.getUint16(n,!1);if(r===0)break;n=n+2;const h=this.getAMFName(t,n,r);n=n+r;const c=this.getAmfType(t,n);if(c===6)break;n=n+1;const g=this.getAMFValue(t,n,c);n=n+g.length,a[h]=g.value,i=2+r+1+g.length}break;case 8:{a={};const r=t.getUint32(n,!1);n=n+4;for(let h=0;h<r;h++){const c=t.getUint16(n,!1);n=n+2;const g=this.getAMFName(t,n,c);n=n+c;const p=this.getAmfType(t,n);n=n+1;const l=this.getAMFValue(t,n,p);n=n+l.length,a[g]=l.value,i=2+c+1+l.length}}break;case 10:{a=[];const r=t.getUint32(n,!1);n=n+4;for(let h=0;h<r;h++){const c=this.getAmfType(t,n);n=n+1;const g=this.getAMFValue(t,n,c);n=n+g.length,a.push(g.value),i=1+g.length}}break}return{amfType:e,length:i,value:a}}}class S{pattern;cacher=new P;isParseing=!1;offset=0;on={};parser;constructor(){}init=t=>{switch(this.destroy(),this.pattern=t,this.pattern){case"flv":this.parser=new L;break;case"hls":this.parser=new D;break;default:throw new Error("is error pattern.")}this.parser.on.debug=s=>this.on.debug&&this.on.debug(s),this.parser.on.info=s=>this.on.info&&this.on.info(s),this.parser.on.config=s=>this.on.config&&this.on.config(s),this.parser.on.chunk=s=>{this.cacher.pushChunk(s),this.on.chunk&&this.on.chunk(s)}};push=t=>{this.cacher.push(t),this.isParseing===!1&&this.parse()};destroy=()=>{this.cacher.destroy(),this.isParseing=!1,this.offset=0};parse=async()=>{try{if(this.isParseing=!0,!this.pattern)throw new Error("You need to set the pattern.");if(!this.parser)throw new Error("You need to init parser.");for(;;){const t=this.cacher.next(this.offset);if(this.offset=0,!t)break;this.offset=await this.parser.parse(t)}this.isParseing=!1}catch{this.destroy()}}}const A=new S;A.on.debug=u=>postMessage({action:"onDebug",data:u}),A.on.info=u=>postMessage({action:"onInfo",data:u}),A.on.config=u=>postMessage({action:"onConfig",data:u}),A.on.chunk=u=>postMessage({action:"onChunk",data:u}),onmessage=u=>{const{action:t,data:s}=u.data,e=A[t];e&&e(s)}})();\n', T = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", D], { type: "text/javascript;charset=utf-8" });
9
+ function L(h) {
10
10
  let o;
11
11
  try {
12
- if (o = A && (self.URL || self.webkitURL).createObjectURL(A), !o) throw "";
13
- const u = new Worker(o, {
14
- name: f == null ? void 0 : f.name
12
+ if (o = T && (self.URL || self.webkitURL).createObjectURL(T), !o) throw "";
13
+ const a = new Worker(o, {
14
+ name: h == null ? void 0 : h.name
15
15
  });
16
- return u.addEventListener("error", () => {
16
+ return a.addEventListener("error", () => {
17
17
  (self.URL || self.webkitURL).revokeObjectURL(o);
18
- }), u;
18
+ }), a;
19
19
  } catch {
20
20
  return new Worker(
21
- "data:text/javascript;charset=utf-8," + encodeURIComponent(L),
21
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(D),
22
22
  {
23
- name: f == null ? void 0 : f.name
23
+ name: h == null ? void 0 : h.name
24
24
  }
25
25
  );
26
26
  }
27
27
  }
28
- class _ {
28
+ class B {
29
29
  constructor() {
30
- v(this, "worker", new E());
31
- v(this, "on", {});
32
- v(this, "init", () => this.worker.postMessage({ action: "init" }));
33
- v(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
34
- v(this, "destroy", () => {
30
+ m(this, "worker", new L());
31
+ m(this, "on", {});
32
+ m(this, "init", (o) => this.worker.postMessage({ action: "init", data: o }));
33
+ m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
34
+ m(this, "destroy", () => {
35
35
  this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
36
36
  });
37
37
  this.worker.onmessage = (o) => {
38
- const { action: u, data: c } = o.data;
39
- u === "onHeader" && this.on.header && this.on.header(c), u === "onTag" && this.on.tag && this.on.tag(c);
38
+ const { action: a, data: u } = o.data;
39
+ switch (a) {
40
+ case "onInfo":
41
+ this.on.info && this.on.info(u);
42
+ break;
43
+ case "onConfig":
44
+ this.on.config && this.on.config(u);
45
+ break;
46
+ case "onDebug":
47
+ this.on.debug && this.on.debug(u);
48
+ break;
49
+ case "onChunk":
50
+ this.on.chunk && this.on.chunk(u);
51
+ break;
52
+ }
40
53
  };
41
54
  }
42
55
  }
43
- const N = `(function(){"use strict";class r{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;on={audio:{},video:{}};constructor(){}audio={init:i=>{this.audio.destroy(),this.audioDecoderConfig={...i},this.audioDecoder=new AudioDecoder({output:e=>{this.on.audio.decode&&this.on.audio.decode(e)},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)},decode:i=>{if(!this.audioDecoder)return;const e=new EncodedAudioChunk(i);this.audioDecoder.decode(e)},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:i=>{this.video.destroy(),this.videoDecoderConfig={...i},this.videoDecoder=new VideoDecoder({output:async e=>{const d=await createImageBitmap(e),s=e.timestamp;e.close(),d.width>0&&d.height>0?this.on.video.decode&&this.on.video.decode({timestamp:s,bitmap:d}):d.close()},error:e=>{this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)},decode:i=>{if(this.videoDecoder&&(i.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame&&this.videoDecoder.decodeQueueSize<2)){const e=new EncodedVideoChunk(i);this.videoDecoder.decode(e)}},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const t=new r;t.on.audio.decode=o=>postMessage({type:"audio",action:"onDecode",data:o}),t.on.audio.error=o=>postMessage({type:"audio",action:"onError",data:o}),t.on.video.decode=o=>postMessage({type:"video",action:"onDecode",data:o}),t.on.video.error=o=>postMessage({type:"video",action:"onError",data:o}),onmessage=o=>{const{type:i,action:e,data:d}=o.data,s=t[i][e];s&&s(d)}})();
44
- `, R = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", N], { type: "text/javascript;charset=utf-8" });
45
- function V(f) {
56
+ const M = `(function(){"use strict";class r{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;on={audio:{},video:{}};constructor(){}audio={init:i=>{this.audio.destroy(),this.audioDecoderConfig={...i},this.audioDecoder=new AudioDecoder({output:e=>{this.on.audio.decode&&this.on.audio.decode(e)},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)},decode:i=>{if(!this.audioDecoder)return;const e=new EncodedAudioChunk(i);this.audioDecoder.decode(e)},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:i=>{this.video.destroy(),this.videoDecoderConfig={...i},this.videoDecoder=new VideoDecoder({output:async e=>{const d=await createImageBitmap(e),s=e.timestamp;e.close(),d.width>0&&d.height>0?this.on.video.decode&&this.on.video.decode({timestamp:s,bitmap:d}):d.close()},error:e=>{console.log("\\x1B[38;2;0;151;255m%c%s\\x1B[0m","color:#0097ff;","------->Breathe: e",e),this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)},decode:i=>{if(this.videoDecoder&&(i.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame&&this.videoDecoder.decodeQueueSize<2)){const e=new EncodedVideoChunk(i);this.videoDecoder.decode(e)}},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const t=new r;t.on.audio.decode=o=>postMessage({type:"audio",action:"onDecode",data:o}),t.on.audio.error=o=>postMessage({type:"audio",action:"onError",data:o}),t.on.video.decode=o=>postMessage({type:"video",action:"onDecode",data:o}),t.on.video.error=o=>postMessage({type:"video",action:"onError",data:o}),onmessage=o=>{const{type:i,action:e,data:d}=o.data,s=t[i][e];s&&s(d)}})();
57
+ `, v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", M], { type: "text/javascript;charset=utf-8" });
58
+ function F(h) {
46
59
  let o;
47
60
  try {
48
- if (o = R && (self.URL || self.webkitURL).createObjectURL(R), !o) throw "";
49
- const u = new Worker(o, {
50
- name: f == null ? void 0 : f.name
61
+ if (o = v && (self.URL || self.webkitURL).createObjectURL(v), !o) throw "";
62
+ const a = new Worker(o, {
63
+ name: h == null ? void 0 : h.name
51
64
  });
52
- return u.addEventListener("error", () => {
65
+ return a.addEventListener("error", () => {
53
66
  (self.URL || self.webkitURL).revokeObjectURL(o);
54
- }), u;
67
+ }), a;
55
68
  } catch {
56
69
  return new Worker(
57
- "data:text/javascript;charset=utf-8," + encodeURIComponent(N),
70
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(M),
58
71
  {
59
- name: f == null ? void 0 : f.name
72
+ name: h == null ? void 0 : h.name
60
73
  }
61
74
  );
62
75
  }
63
76
  }
64
- class j {
77
+ class N {
65
78
  constructor() {
66
- v(this, "worker", new V());
67
- v(this, "on", { audio: {}, video: {} });
68
- v(this, "audio", {
79
+ m(this, "worker", new F());
80
+ m(this, "on", { audio: {}, video: {} });
81
+ m(this, "audio", {
69
82
  init: (o) => this.worker.postMessage({ type: "audio", action: "init", data: o }),
70
83
  decode: (o) => this.worker.postMessage({ type: "audio", action: "decode", data: o }),
71
84
  flush: () => this.worker.postMessage({ type: "audio", action: "flush" }),
@@ -73,7 +86,7 @@ class j {
73
86
  this.worker.postMessage({ type: "audio", action: "destroy" });
74
87
  }
75
88
  });
76
- v(this, "video", {
89
+ m(this, "video", {
77
90
  init: (o) => this.worker.postMessage({ type: "video", action: "init", data: o }),
78
91
  decode: (o) => this.worker.postMessage({ type: "video", action: "decode", data: o }),
79
92
  flush: () => this.worker.postMessage({ type: "video", action: "flush" }),
@@ -81,122 +94,87 @@ class j {
81
94
  this.worker.postMessage({ type: "video", action: "destroy", data: {} });
82
95
  }
83
96
  });
84
- v(this, "destroy", () => {
97
+ m(this, "destroy", () => {
85
98
  this.worker.postMessage({ type: "audio", action: "destroy" }), this.worker.postMessage({ type: "video", action: "destroy", data: {} }), this.worker.terminate();
86
99
  });
87
100
  this.worker.onmessage = (o) => {
88
- const { type: u, action: c, data: r } = o.data;
89
- switch (u) {
101
+ const { type: a, action: u, data: n } = o.data;
102
+ switch (a) {
90
103
  case "audio":
91
- c === "onDecode" && this.on.audio.decode && this.on.audio.decode(r), c === "onError" && this.on.audio.error && this.on.audio.error(r);
104
+ u === "onDecode" && this.on.audio.decode && this.on.audio.decode(n), u === "onError" && this.on.audio.error && this.on.audio.error(n);
92
105
  break;
93
106
  case "video":
94
- c === "onDecode" && this.on.video.decode && this.on.video.decode(r), c === "onError" && this.on.video.error && this.on.video.error(r);
107
+ u === "onDecode" && this.on.video.decode && this.on.video.decode(n), u === "onError" && this.on.video.error && this.on.video.error(n);
95
108
  break;
96
109
  }
97
110
  };
98
111
  }
99
112
  }
100
- const F = `(function(){"use strict";class r{isRendering=!1;pendingFrames=[];offscreenCanvas;writable;writer;ctx;cutOption;baseTime=0;pause=!1;shader=["stream"];constructor(){}init=({offscreenCanvas:e,baseTime:t=performance.timeOrigin,writable:i})=>{this.destroy(),this.offscreenCanvas=e,this.writable=i,this.writer=this.writable.getWriter(),this.ctx=this.offscreenCanvas.getContext("2d"),this.baseTime=t};setShader=e=>{this.shader=e};setSize=({width:e,height:t})=>{this.offscreenCanvas&&(this.offscreenCanvas.width=e,this.offscreenCanvas.height=t)};destroy=()=>{this.isRendering=!1,this.pendingFrames=[],this.offscreenCanvas=void 0,this.ctx=void 0,this.baseTime=0};push=e=>{this.pendingFrames.push(e),this.isRendering===!1&&setTimeout(this.renderFrame,0)};setCut=e=>{this.cutOption=e};setPause=e=>{this.pause=e,this.isRendering===!1&&setTimeout(this.renderFrame,0)};calculateTimeUntilNextFrame=e=>{const t=performance.timeOrigin+performance.now(),s=this.baseTime+e/1e3-t;return Math.max(0,s)};renderFrame=async()=>{for(this.isRendering=!0;;){const e=this.pendingFrames.shift();if(!e)break;let{timestamp:t,bitmap:i}=e;if(this.cutOption){const{sx:a=0,sy:c=0,sw:m=i.width,sh:o=i.height}=this.cutOption;i=await createImageBitmap(i,a,c,m,o)}const s=this.calculateTimeUntilNextFrame(t);await new Promise(a=>setTimeout(()=>a(!0),s)),this.drawImage({timestamp:t,bitmap:i}),this.cutOption&&i.close()}this.isRendering=!1};drawImage=e=>{if(this.pause!==!0){if(this.shader.includes("stream")){const t=new VideoFrame(e.bitmap,{timestamp:e.timestamp});this.writer.write(t),t.close()}this.shader.includes("canvas")&&this.ctx&&this.offscreenCanvas&&this.ctx.drawImage(e.bitmap,0,0,this.offscreenCanvas.width,this.offscreenCanvas.height)}}}const h=new r;onmessage=n=>{const{action:e,data:t}=n.data,i=h[e];i&&i(t)}})();
101
- `, M = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", F], { type: "text/javascript;charset=utf-8" });
102
- function H(f) {
103
- let o;
104
- try {
105
- if (o = M && (self.URL || self.webkitURL).createObjectURL(M), !o) throw "";
106
- const u = new Worker(o, {
107
- name: f == null ? void 0 : f.name
108
- });
109
- return u.addEventListener("error", () => {
110
- (self.URL || self.webkitURL).revokeObjectURL(o);
111
- }), u;
112
- } catch {
113
- return new Worker(
114
- "data:text/javascript;charset=utf-8," + encodeURIComponent(F),
113
+ var E = Object.defineProperty, G = (h, o, a) => o in h ? E(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a, f = (h, o, a) => G(h, typeof o != "symbol" ? o + "" : o, a);
114
+ class O {
115
+ constructor(o, a) {
116
+ f(this, "inputStream", new MediaStream()), f(this, "outputStream", new MediaStream()), f(this, "inputGain", 1), f(this, "enhanceGain", 1), f(this, "bgsGain", 1), f(this, "bgmGain", 1), f(this, "outputGain", 1), f(this, "mixAudioMap", /* @__PURE__ */ new Map()), f(this, "audioContext", new AudioContext()), f(this, "sourceNode"), f(this, "inputGainNode"), f(this, "enhanceGainNode"), f(this, "bgsGainNode"), f(this, "bgmGainNode"), f(this, "analyserNode"), f(this, "analyserArrayData"), f(this, "outputGainNode"), f(this, "destinationNode"), f(this, "filterStream", (u) => u), f(this, "stop", () => {
115
117
  {
116
- name: f == null ? void 0 : f.name
117
- }
118
- );
119
- }
120
- }
121
- class $ {
122
- constructor() {
123
- v(this, "worker", new H());
124
- v(this, "init", ({ offscreenCanvas: o, baseTime: u = 0, writable: c }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, baseTime: u, writable: c } }, [o, c]));
125
- v(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
126
- v(this, "setSize", ({ width: o, height: u }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: u } }));
127
- v(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
128
- v(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
129
- v(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
130
- v(this, "destroy", () => {
131
- this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
132
- });
133
- }
134
- }
135
- var q = Object.defineProperty, K = (f, o, u) => o in f ? q(f, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[o] = u, h = (f, o, u) => K(f, typeof o != "symbol" ? o + "" : o, u);
136
- class Q {
137
- constructor(o, u) {
138
- h(this, "inputStream", new MediaStream()), h(this, "outputStream", new MediaStream()), h(this, "inputGain", 1), h(this, "enhanceGain", 1), h(this, "bgsGain", 1), h(this, "bgmGain", 1), h(this, "outputGain", 1), h(this, "mixAudioMap", /* @__PURE__ */ new Map()), h(this, "audioContext", new AudioContext()), h(this, "sourceNode"), h(this, "inputGainNode"), h(this, "enhanceGainNode"), h(this, "bgsGainNode"), h(this, "bgmGainNode"), h(this, "analyserNode"), h(this, "analyserArrayData"), h(this, "outputGainNode"), h(this, "destinationNode"), h(this, "filterStream", (c) => c), h(this, "stop", () => {
139
- {
140
- const c = this.inputStream.getTracks();
141
- for (const r of c)
142
- r.stop(), this.inputStream.removeTrack(r);
118
+ const u = this.inputStream.getTracks();
119
+ for (const n of u)
120
+ n.stop(), this.inputStream.removeTrack(n);
143
121
  }
144
- }), h(this, "getStream", () => this.filterStream(this.outputStream)), h(this, "setMute", (c = !0) => {
145
- c ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
146
- }), h(this, "setInputGain", (c) => {
147
- this.inputGain = c, this.inputGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
148
- }), h(this, "setEnhanceGain", async (c) => {
149
- this.enhanceGain = c + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
150
- }), h(this, "setBgsGain", (c) => {
151
- this.bgsGain = c, this.bgsGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
152
- }), h(this, "setBgmGain", (c) => {
153
- this.bgmGain = c, this.bgmGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
154
- }), h(this, "setOutputGain", (c) => {
155
- this.outputGain = c, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
156
- }), h(this, "getVolume", () => {
157
- const { analyserNode: c, analyserArrayData: r } = this;
158
- c.getByteFrequencyData(r);
159
- let n = 0;
160
- for (let i = 0; i < r.length; i++)
161
- n += r[i];
162
- return Math.ceil(n / r.length);
163
- }), h(this, "mixAudio", (c, r = "bgm") => new Promise(async (n, i) => {
122
+ }), f(this, "getStream", () => this.filterStream(this.outputStream)), f(this, "setMute", (u = !0) => {
123
+ u ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
124
+ }), f(this, "setInputGain", (u) => {
125
+ this.inputGain = u, this.inputGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
126
+ }), f(this, "setEnhanceGain", async (u) => {
127
+ this.enhanceGain = u + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
128
+ }), f(this, "setBgsGain", (u) => {
129
+ this.bgsGain = u, this.bgsGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
130
+ }), f(this, "setBgmGain", (u) => {
131
+ this.bgmGain = u, this.bgmGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
132
+ }), f(this, "setOutputGain", (u) => {
133
+ this.outputGain = u, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
134
+ }), f(this, "getVolume", () => {
135
+ const { analyserNode: u, analyserArrayData: n } = this;
136
+ u.getByteFrequencyData(n);
137
+ let r = 0;
138
+ for (let i = 0; i < n.length; i++)
139
+ r += n[i];
140
+ return Math.ceil(r / n.length);
141
+ }), f(this, "mixAudio", (u, n = "bgm") => new Promise(async (r, i) => {
164
142
  try {
165
143
  {
166
- const s = this.mixAudioMap.get(r);
144
+ const s = this.mixAudioMap.get(n);
167
145
  s && s.stop();
168
146
  }
169
- const e = r === "bgs" ? this.bgsGainNode : this.bgmGainNode, t = this.audioContext.createBufferSource();
170
- this.mixAudioMap.set(r, t), t.buffer = c, t.connect(e), t.onended = () => {
171
- t.disconnect(e), this.mixAudioMap.delete(r), n(!0);
172
- }, t.start(0);
173
- } catch (e) {
174
- i(e);
147
+ const t = n === "bgs" ? this.bgsGainNode : this.bgmGainNode, e = this.audioContext.createBufferSource();
148
+ this.mixAudioMap.set(n, e), e.buffer = u, e.connect(t), e.onended = () => {
149
+ e.disconnect(t), this.mixAudioMap.delete(n), r(!0);
150
+ }, e.start(0);
151
+ } catch (t) {
152
+ i(t);
175
153
  }
176
- })), h(this, "mixAudioStop", (c) => {
177
- const r = this.mixAudioMap.get(c);
178
- r == null || r.stop();
179
- }), h(this, "changeMix", (c, r) => {
180
- const n = c === "bgs" ? this.bgsGainNode : this.bgmGainNode;
181
- r ? n.connect(this.destinationNode) : n.disconnect(this.destinationNode);
182
- }), u && (this.audioContext = u), this.inputStream = o, 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;
154
+ })), f(this, "mixAudioStop", (u) => {
155
+ const n = this.mixAudioMap.get(u);
156
+ n == null || n.stop();
157
+ }), f(this, "changeMix", (u, n) => {
158
+ const r = u === "bgs" ? this.bgsGainNode : this.bgmGainNode;
159
+ n ? r.connect(this.destinationNode) : r.disconnect(this.destinationNode);
160
+ }), a && (this.audioContext = a), this.inputStream = o, 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;
183
161
  {
184
- const { sourceNode: c, inputGainNode: r, enhanceGainNode: n, bgsGainNode: i, bgmGainNode: e, analyserNode: t, outputGainNode: s, destinationNode: l } = this;
185
- c.connect(r), r.connect(n), n.connect(t), i.connect(t), e.connect(t), n.connect(l), i.connect(l), e.connect(l), t.connect(s), s.connect(this.audioContext.destination);
162
+ const { sourceNode: u, inputGainNode: n, enhanceGainNode: r, bgsGainNode: i, bgmGainNode: t, analyserNode: e, outputGainNode: s, destinationNode: l } = this;
163
+ u.connect(n), n.connect(r), r.connect(e), i.connect(e), t.connect(e), r.connect(l), i.connect(l), t.connect(l), e.connect(s), s.connect(this.audioContext.destination);
186
164
  }
187
165
  this.setMute(!0), this.audioContext.resume();
188
166
  }
189
167
  }
190
- const J = async (f, o) => {
168
+ const W = async (h, o) => {
191
169
  try {
192
- const { format: u, numberOfChannels: c, numberOfFrames: r, sampleRate: n } = o, i = f.createBuffer(c, r, n);
193
- for (let e = 0; e < c; e++) {
194
- const t = o.allocationSize({ planeIndex: e }), s = new Uint8Array(t);
195
- o.copyTo(s, { planeIndex: e });
196
- const l = new DataView(s.buffer), a = i.getChannelData(e);
197
- for (let d = 0; d < r; d++) {
170
+ const { format: a, numberOfChannels: u, numberOfFrames: n, sampleRate: r } = o, i = h.createBuffer(u, n, r);
171
+ for (let t = 0; t < u; t++) {
172
+ const e = o.allocationSize({ planeIndex: t }), s = new Uint8Array(e);
173
+ o.copyTo(s, { planeIndex: t });
174
+ const l = new DataView(s.buffer), c = i.getChannelData(t);
175
+ for (let d = 0; d < n; d++) {
198
176
  let y;
199
- switch (u) {
177
+ switch (a) {
200
178
  case "s16":
201
179
  // 16-bit signed PCM (范围: -32768 ~ 32767)
202
180
  case "s16-planar":
@@ -213,28 +191,28 @@ const J = async (f, o) => {
213
191
  y = (l.getUint8(d) - 128) / 128;
214
192
  break;
215
193
  default:
216
- throw new Error(`Unsupported audio format: ${u}`);
194
+ throw new Error(`Unsupported audio format: ${a}`);
217
195
  }
218
- a[d] = Math.max(-1, Math.min(1, y));
196
+ c[d] = Math.max(-1, Math.min(1, y));
219
197
  }
220
198
  }
221
199
  return i;
222
- } catch (u) {
223
- throw console.error("Failed to convert AudioData to AudioBuffer:", u), u;
200
+ } catch (a) {
201
+ throw console.error("Failed to convert AudioData to AudioBuffer:", a), a;
224
202
  }
225
203
  };
226
- class X {
204
+ class V {
227
205
  constructor() {
228
- v(this, "prAudioStream");
229
- v(this, "audioContext");
230
- v(this, "destination");
231
- v(this, "stream", new MediaStream());
232
- v(this, "nextStartTime", 0);
233
- v(this, "pendingSources", []);
234
- v(this, "init", (o) => {
235
- o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new Q(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
206
+ m(this, "prAudioStream");
207
+ m(this, "audioContext");
208
+ m(this, "destination");
209
+ m(this, "stream", new MediaStream());
210
+ m(this, "nextStartTime", 0);
211
+ m(this, "pendingSources", []);
212
+ m(this, "init", (o) => {
213
+ o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new O(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
236
214
  });
237
- v(this, "getStream", () => {
215
+ m(this, "getStream", () => {
238
216
  var o;
239
217
  return (o = this.prAudioStream) == null ? void 0 : o.getStream();
240
218
  });
@@ -242,206 +220,367 @@ class X {
242
220
  async push(o) {
243
221
  try {
244
222
  if (!this.audioContext || !this.destination) return;
245
- const u = await J(this.audioContext, o);
246
- if (!u) return;
247
- const c = this.audioContext.createBufferSource();
248
- c.buffer = u, c.connect(this.destination);
249
- const r = Math.max(this.nextStartTime, this.audioContext.currentTime);
250
- this.nextStartTime = r + u.duration, c.start(r), this.pendingSources.push(c), c.onended = () => {
251
- this.pendingSources = this.pendingSources.filter((n) => n !== c);
223
+ const a = await W(this.audioContext, o);
224
+ if (!a) return;
225
+ const u = this.audioContext.createBufferSource();
226
+ u.buffer = a, u.connect(this.destination);
227
+ const n = Math.max(this.nextStartTime, this.audioContext.currentTime);
228
+ this.nextStartTime = n + a.duration, u.start(n), this.pendingSources.push(u), u.onended = () => {
229
+ this.pendingSources = this.pendingSources.filter((r) => r !== u);
252
230
  }, this.audioContext.state === "suspended" && await this.audioContext.resume();
253
231
  } finally {
254
232
  o.close();
255
233
  }
256
234
  }
257
235
  destroy() {
258
- var o, u;
259
- (o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (u = this.prAudioStream) == null || u.stop(), this.pendingSources.forEach((c) => c.stop()), this.pendingSources = [];
236
+ var o, a;
237
+ (o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (a = this.prAudioStream) == null || a.stop(), this.pendingSources.forEach((u) => u.stop()), this.pendingSources = [];
238
+ }
239
+ }
240
+ const S = `(function(){"use strict";class r{isRendering=!1;pendingFrames=[];offscreenCanvas;writable;writer;ctx;cutOption;baseTime=0;pause=!1;shader=["stream"];constructor(){}init=({offscreenCanvas:e,writable:t})=>{this.destroy(),this.offscreenCanvas=e,this.writable=t,this.writer=this.writable.getWriter(),this.ctx=this.offscreenCanvas.getContext("2d")};setBaseTime=e=>{this.baseTime=e};setShader=e=>{this.shader=e};setSize=({width:e,height:t})=>{this.offscreenCanvas&&(this.offscreenCanvas.width=e,this.offscreenCanvas.height=t)};destroy=()=>{this.isRendering=!1,this.pendingFrames=[],this.offscreenCanvas=void 0,this.ctx=void 0,this.baseTime=0};push=e=>{this.pendingFrames.push(e),this.isRendering===!1&&setTimeout(this.renderFrame,0)};setCut=e=>{this.cutOption=e};setPause=e=>{this.pause=e,this.isRendering===!1&&setTimeout(this.renderFrame,0)};calculateTimeUntilNextFrame=e=>{const t=performance.timeOrigin+performance.now(),i=this.baseTime+e/1e3-t;return Math.max(0,i)};renderFrame=async()=>{for(this.isRendering=!0;;){const e=this.pendingFrames.shift();if(!e)break;let{timestamp:t,bitmap:s}=e;if(this.cutOption){const{sx:a=0,sy:c=0,sw:m=s.width,sh:o=s.height}=this.cutOption;s=await createImageBitmap(s,a,c,m,o)}const i=this.calculateTimeUntilNextFrame(t);await new Promise(a=>setTimeout(()=>a(!0),i)),this.drawImage({timestamp:t,bitmap:s}),this.cutOption&&s.close()}this.isRendering=!1};drawImage=e=>{if(this.pause!==!0){if(this.shader.includes("stream")){const t=new VideoFrame(e.bitmap,{timestamp:e.timestamp});this.writer.write(t),t.close()}this.shader.includes("canvas")&&this.ctx&&this.offscreenCanvas&&this.ctx.drawImage(e.bitmap,0,0,this.offscreenCanvas.width,this.offscreenCanvas.height)}}}const h=new r;onmessage=n=>{const{action:e,data:t}=n.data,s=h[e];s&&s(t)}})();
241
+ `, x = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
242
+ function z(h) {
243
+ let o;
244
+ try {
245
+ if (o = x && (self.URL || self.webkitURL).createObjectURL(x), !o) throw "";
246
+ const a = new Worker(o, {
247
+ name: h == null ? void 0 : h.name
248
+ });
249
+ return a.addEventListener("error", () => {
250
+ (self.URL || self.webkitURL).revokeObjectURL(o);
251
+ }), a;
252
+ } catch {
253
+ return new Worker(
254
+ "data:text/javascript;charset=utf-8," + encodeURIComponent(S),
255
+ {
256
+ name: h == null ? void 0 : h.name
257
+ }
258
+ );
260
259
  }
261
260
  }
262
- var S, T;
263
- class Y {
261
+ class j {
262
+ constructor() {
263
+ m(this, "worker", new z());
264
+ m(this, "init", ({ offscreenCanvas: o, writable: a }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, writable: a } }, [o, a]));
265
+ m(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
266
+ m(this, "setBaseTime", (o) => this.worker.postMessage({ action: "setBaseTime", data: o }));
267
+ m(this, "setSize", ({ width: o, height: a }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: a } }));
268
+ m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
269
+ m(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
270
+ m(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
271
+ m(this, "destroy", () => {
272
+ this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
273
+ });
274
+ }
275
+ }
276
+ const $ = (h) => {
277
+ const o = h.toLowerCase();
278
+ return o.includes(".m3u8") || o.includes("hls") || o.includes("master.m3u8") || o.match(/index\d*\.m3u8/) ? "hls" : o.includes(".mpd") || o.includes("dash") ? "dash" : o.startsWith("rtmp://") || o.startsWith("rtmps://") ? "rtmp" : o.includes(".flv") || o.includes("flv") && !o.includes("flash") ? "flv" : "unknown";
279
+ }, P = (h) => {
280
+ const o = (h == null ? void 0 : h.getTracks()) || [];
281
+ for (const a of o)
282
+ a.stop();
283
+ }, A = () => {
284
+ const h = new j(), o = document.createElement("canvas"), a = o.transferControlToOffscreen(), u = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([u]), r = () => {
285
+ h.destroy(), P(n);
286
+ };
287
+ return h.init({ offscreenCanvas: a, writable: u.writable }), { worker: h, canvas: o, stream: n, destroy: r };
288
+ };
289
+ class H {
290
+ constructor() {
291
+ m(this, "resolvesMap", /* @__PURE__ */ new Map());
292
+ m(this, "index", 0);
293
+ /**
294
+ *
295
+ * @param eventKey 唯一key
296
+ * @param checkFun 检测函数
297
+ * @param timeout 超时时间 ms
298
+ * @returns
299
+ */
300
+ m(this, "add", (o, a = () => !1, u = 0) => new Promise((n) => {
301
+ var t, e;
302
+ if (a()) return n(!0);
303
+ this.resolvesMap.has(o) || this.resolvesMap.set(o, /* @__PURE__ */ new Map()), this.index++;
304
+ const r = `${this.index}`;
305
+ if (u = Math.max(0, u), u === 0) {
306
+ (t = this.resolvesMap.get(o)) == null || t.set(r, { resolve: n, timer: 0 });
307
+ return;
308
+ }
309
+ const i = window.setTimeout(() => {
310
+ this.emit(o);
311
+ }, u);
312
+ (e = this.resolvesMap.get(o)) == null || e.set(r, { resolve: n, timer: i });
313
+ }));
314
+ m(this, "emit", async (o) => {
315
+ const a = this.resolvesMap.get(o);
316
+ if (!a) return;
317
+ const u = [...a.keys()];
318
+ for (const n of u) {
319
+ const r = a.get(n);
320
+ r && (clearTimeout(r.timer), r.resolve(), a.delete(n));
321
+ }
322
+ });
323
+ }
324
+ }
325
+ const Y = (h) => {
326
+ const o = new DataView(h.buffer);
327
+ let a = 0, u, n, r;
328
+ u = o.getUint32(a, !1), a += 4;
329
+ {
330
+ const i = o.getUint8(a), t = i >> 7 & 1, e = i >> 5 & 3, s = i & 31;
331
+ n = { forbidden_zero_bit: t, nal_ref_idc: e, nal_unit_type: s }, a += 1;
332
+ }
333
+ {
334
+ const i = u - 1;
335
+ r = new Uint8Array(o.buffer.slice(a, a + i));
336
+ }
337
+ return { size: u, header: n, data: r };
338
+ };
339
+ var q, I;
340
+ class C {
264
341
  constructor(o = {}) {
265
- P(this, S, {
266
- timeout: 5 * 1e3
342
+ J(this, q, {
343
+ timeout: 5 * 1e3,
344
+ check: !1
267
345
  });
268
- P(this, T);
346
+ J(this, I);
269
347
  /**
270
348
  *
271
349
  * @param input string | URL | Request
272
350
  * @param init RequestInit
273
351
  */
274
- v(this, "check", (o, u) => new Promise(async (c, r) => {
352
+ m(this, "check", (o, a) => new Promise(async (u, n) => {
275
353
  var i;
276
- this.stop(), C(this, T, new AbortController());
277
- const n = window.setTimeout(() => {
278
- var e;
279
- (e = x(this, T)) == null || e.abort("Timeout."), r({ status: "timeout", reason: "" });
280
- }, x(this, S).timeout);
354
+ this.stop(), K(this, I, new AbortController());
355
+ const r = window.setTimeout(() => {
356
+ var t;
357
+ (t = U(this, I)) == null || t.abort("Timeout."), n({ status: "timeout", reason: "" });
358
+ }, U(this, q).timeout);
281
359
  try {
282
- const e = await fetch(o, { ...u, method: "HEAD", signal: (i = x(this, T)) == null ? void 0 : i.signal });
283
- e.status === 200 ? c({ status: "successed", reason: "" }) : r({ status: "failed", reason: `${e.status}` });
284
- } catch (e) {
285
- r({ status: "error", reason: e.message });
360
+ const t = await fetch(o, { ...a, method: "HEAD", signal: (i = U(this, I)) == null ? void 0 : i.signal });
361
+ t.status === 200 ? u({ status: "successed", reason: "" }) : n({ status: "failed", reason: `${t.status}` });
362
+ } catch (t) {
363
+ n({ status: "error", reason: t.message });
286
364
  }
287
- clearTimeout(n);
365
+ clearTimeout(r);
288
366
  }));
289
367
  /**
290
368
  *
291
369
  * @param input string | URL | Request
292
370
  * @param init RequestInit
293
371
  */
294
- v(this, "request", async (o, u) => new Promise(async (c, r) => {
295
- var n;
372
+ m(this, "request", async (o, a) => new Promise(async (u, n) => {
373
+ var r;
296
374
  try {
297
- await this.check(o, u), C(this, T, new AbortController());
298
- const i = await fetch(o, { ...u, signal: (n = x(this, T)) == null ? void 0 : n.signal });
299
- c(i);
375
+ U(this, q).check && await this.check(o, a), K(this, I, new AbortController());
376
+ const i = await fetch(o, { ...a, signal: (r = U(this, I)) == null ? void 0 : r.signal });
377
+ u(i);
300
378
  } catch (i) {
301
- this.stop(), r(i);
379
+ this.stop(), n(i);
302
380
  }
303
381
  }));
304
382
  /**
305
383
  * stop
306
384
  */
307
- v(this, "stop", () => {
385
+ m(this, "stop", () => {
308
386
  var o;
309
- ((o = x(this, T)) == null ? void 0 : o.signal.aborted) === !1 && x(this, T).abort("Actively stop.");
387
+ ((o = U(this, I)) == null ? void 0 : o.signal.aborted) === !1 && U(this, I).abort("Actively stop.");
310
388
  });
311
- C(this, S, { ...x(this, S), ...o });
389
+ K(this, q, { ...U(this, q), ...o });
312
390
  }
313
391
  }
314
- S = new WeakMap(), T = new WeakMap();
315
- const O = (f) => {
316
- const o = (f == null ? void 0 : f.getTracks()) || [];
317
- for (const u of o)
318
- u.stop();
319
- }, G = (f) => {
320
- const o = new $(), u = document.createElement("canvas"), c = u.transferControlToOffscreen(), r = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([r]), i = () => {
321
- o.destroy(), O(n);
322
- };
323
- return o.init({ offscreenCanvas: c, baseTime: f, writable: r.writable }), { worker: o, canvas: u, stream: n, destroy: i };
324
- };
325
- class be {
392
+ q = new WeakMap(), I = new WeakMap();
393
+ class et {
326
394
  constructor() {
327
- v(this, "prFetch", new Y());
328
- v(this, "demuxerWorker");
329
- v(this, "decoderWorker");
330
- v(this, "audioPlayer");
331
- v(this, "renderWorker");
332
- v(this, "renderBaseTime", 0);
333
- v(this, "stream");
334
- v(this, "canvas");
335
- v(this, "on", { demuxer: {}, decoder: {} });
336
- v(this, "cutRenders", /* @__PURE__ */ new Map());
395
+ m(this, "prFetch", new C());
396
+ m(this, "prResolves", new H());
397
+ m(this, "url", "");
398
+ m(this, "demuxerWorker");
399
+ m(this, "decoderWorker");
400
+ m(this, "audioPlayer");
401
+ m(this, "renderWorker");
402
+ m(this, "renderBaseTime");
403
+ m(this, "stream");
404
+ m(this, "canvas");
405
+ m(this, "on", { demuxer: {}, decoder: {} });
406
+ m(this, "cutRenders", /* @__PURE__ */ new Map());
337
407
  // @ts-ignore
338
- v(this, "trackGenerator");
408
+ m(this, "trackGenerator");
339
409
  /**
340
410
  * 初始化
341
411
  */
342
- v(this, "init", () => {
343
- this.initDemuxer(), this.initDecoder(), this.audioPlayer = new X(), this.audioPlayer.init(), this.initRender();
412
+ m(this, "init", () => {
413
+ this.initDecoder(), this.audioPlayer = new V(), this.audioPlayer.init(), this.initRender();
344
414
  });
345
415
  /**
346
416
  * 开始播放
347
417
  * @param url : string
348
418
  */
349
- v(this, "start", async (o) => (this.stop(), this.renderBaseTime = (/* @__PURE__ */ new Date()).getTime(), this.init(), this.prFetch.request(o).then(async (u) => {
350
- var n;
351
- const c = (n = u.body) == null ? void 0 : n.getReader();
352
- if (!c) throw new Error("Reader is error.");
353
- const r = () => {
354
- c.read().then(({ done: i, value: e }) => {
355
- var t;
356
- e && ((t = this.demuxerWorker) == null || t.push(e)), !i && r();
357
- }).catch((i) => {
358
- if (i.name !== "AbortError") throw i;
359
- });
360
- };
361
- r();
362
- }).catch((u) => {
363
- console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: err", u);
364
- })));
419
+ m(this, "start", async (o) => {
420
+ this.stop(), this.url = o, this.init();
421
+ const a = $(o);
422
+ if (a === "unknown") throw new Error("This address cannot be parsed.");
423
+ switch (this.initDemuxer(a), a) {
424
+ case "flv":
425
+ this.flv.start();
426
+ break;
427
+ case "hls":
428
+ this.hls.start();
429
+ break;
430
+ }
431
+ });
365
432
  /**
366
433
  * 停止
367
434
  */
368
- v(this, "stop", async () => {
369
- var u, c, r, n;
435
+ m(this, "stop", async () => {
436
+ var a, u, n, r;
370
437
  try {
371
- this.prFetch.stop();
438
+ clearInterval(this.hls.getSegmentsTimer), this.prFetch.stop();
372
439
  } catch (i) {
373
440
  console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", i);
374
441
  }
375
- (u = this.demuxerWorker) == null || u.destroy(), (c = this.decoderWorker) == null || c.destroy(), (r = this.renderWorker) == null || r.destroy(), O(this.stream);
442
+ (a = this.demuxerWorker) == null || a.destroy(), (u = this.decoderWorker) == null || u.destroy(), (n = this.renderWorker) == null || n.destroy(), P(this.stream);
376
443
  const o = [...this.cutRenders.keys()];
377
444
  for (const i of o)
378
445
  this.cut.remove(i);
379
- (n = this.audioPlayer) == null || n.destroy(), this.renderBaseTime = 0, this.canvas = void 0;
446
+ (r = this.audioPlayer) == null || r.destroy(), this.renderBaseTime = void 0, this.canvas = void 0;
447
+ });
448
+ m(this, "getCanvas", () => this.canvas);
449
+ m(this, "getStream", () => this.stream);
450
+ m(this, "setPause", (o) => {
451
+ var a;
452
+ (a = this.renderWorker) == null || a.setPause(o);
453
+ });
454
+ /**
455
+ * 设置渲染模式
456
+ */
457
+ m(this, "setShader", (o) => {
458
+ var a;
459
+ (a = this.renderWorker) == null || a.setShader(o);
380
460
  });
381
461
  /**
382
- * 监听媒体 tag
462
+ * 是否静音 默认为true
463
+ * @param state?: boolean
383
464
  */
384
- v(this, "onTag", (o) => {
385
- var i;
386
- if (!this.decoderWorker) return;
387
- const { header: u, body: c } = o, { tagType: r, timestamp: n } = u;
388
- switch (r) {
389
- case "script":
390
- {
391
- const { width: e, height: t } = c;
392
- (i = this.renderWorker) == null || i.setSize({ width: e, height: t }), this.on.demuxer.script && this.on.demuxer.script(o);
393
- }
394
- break;
395
- case "audio":
396
- {
397
- const { accPacketType: e, data: t } = c;
398
- if (e === 0) {
399
- const { codec: s, sampleRate: l, channelConfiguration: a } = c, d = { codec: s, sampleRate: l, numberOfChannels: a, description: new Uint8Array([]) };
400
- this.decoderWorker.audio.init(d);
401
- } else e === 1 && this.decoderWorker.audio.decode({ type: "key", timestamp: n * 1, data: t });
402
- this.on.demuxer.audio && this.on.demuxer.audio(o);
403
- }
404
- break;
405
- case "video":
406
- {
407
- const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } = c;
408
- if (e === 0) {
409
- const { codec: a, data: d } = c;
410
- this.decoderWorker.video.init({ codec: a, description: d });
411
- } else if (e === 1) {
412
- const a = t === 1 ? "key" : "delta";
413
- this.decoderWorker.video.decode({ type: a, timestamp: n * 1e3, data: s });
414
- for (const d of l) {
415
- const { header: y, payload: p } = d, { nal_unit_type: w } = y;
416
- w === 6 && this.on.demuxer.sei && this.on.demuxer.sei(p);
417
- }
418
- }
419
- this.on.demuxer.video && this.on.demuxer.video(o);
420
- }
421
- break;
465
+ m(this, "setMute", (o) => {
466
+ var a, u;
467
+ return (u = (a = this.audioPlayer) == null ? void 0 : a.prAudioStream) == null ? void 0 : u.setMute(o);
468
+ });
469
+ /**
470
+ * 是否已准备好
471
+ */
472
+ m(this, "isReady", () => {
473
+ const o = () => {
474
+ var a;
475
+ return ((a = this.stream) == null ? void 0 : a.active) === !0;
476
+ };
477
+ return this.prResolves.add("isReady", o);
478
+ });
479
+ m(this, "cut", {
480
+ /**
481
+ * 创建剪切
482
+ */
483
+ create: (o, a) => {
484
+ let u = this.cutRenders.get(o);
485
+ return u ? (u.worker.setCut(a), u.worker.setPause(!1), u) : (u = A(), u.worker.setBaseTime(this.renderBaseTime || 0), u.worker.setCut(a), this.cutRenders.set(o, u), u);
486
+ },
487
+ getCanvas: (o) => {
488
+ var a;
489
+ return (a = this.cutRenders.get(o)) == null ? void 0 : a.canvas;
490
+ },
491
+ getStream: (o) => {
492
+ var a;
493
+ return (a = this.cutRenders.get(o)) == null ? void 0 : a.stream;
494
+ },
495
+ setPause: (o, a) => {
496
+ var u;
497
+ (u = this.cutRenders.get(o)) == null || u.worker.setPause(a);
498
+ },
499
+ /**
500
+ * 设置渲染模式
501
+ */
502
+ setShader: (o, a) => {
503
+ var u;
504
+ (u = this.cutRenders.get(o)) == null || u.worker.setShader(a);
505
+ },
506
+ /**
507
+ * 移除剪切
508
+ */
509
+ remove: (o) => {
510
+ var a;
511
+ (a = this.cutRenders.get(o)) == null || a.destroy(), this.cutRenders.delete(o);
422
512
  }
423
513
  });
424
514
  /**
425
- * 初始化分离器
515
+ * 初始化解复器
426
516
  */
427
- v(this, "initDemuxer", () => {
428
- this.demuxerWorker = new _(), this.demuxerWorker.init(), this.demuxerWorker.on.tag = this.onTag;
517
+ m(this, "initDemuxer", (o) => {
518
+ this.demuxerWorker = new B(), this.demuxerWorker.init(o), this.demuxerWorker.on.debug = (a) => {
519
+ }, this.demuxerWorker.on.info = (a) => {
520
+ this.on.demuxer.info && this.on.demuxer.info(a);
521
+ }, this.demuxerWorker.on.config = (a) => {
522
+ var n, r;
523
+ this.on.demuxer.config && this.on.demuxer.config(a);
524
+ const { kind: u } = a;
525
+ switch (u) {
526
+ case "audio":
527
+ {
528
+ const { codec: i, sampleRate: t, numberOfChannels: e } = a;
529
+ (n = this.decoderWorker) == null || n.audio.init({ codec: i, sampleRate: t, numberOfChannels: e });
530
+ }
531
+ break;
532
+ case "video":
533
+ {
534
+ const { codec: i, description: t } = a;
535
+ (r = this.decoderWorker) == null || r.video.init({ codec: i, description: t });
536
+ }
537
+ break;
538
+ }
539
+ }, this.demuxerWorker.on.chunk = (a) => {
540
+ var n;
541
+ if (this.on.demuxer.chunk && this.on.demuxer.chunk(a), !this.decoderWorker) return;
542
+ const { kind: u } = a;
543
+ switch (u) {
544
+ case "audio":
545
+ {
546
+ const { type: r, dts: i, data: t } = a, e = i * 1;
547
+ this.decoderWorker.audio.decode({ type: r, timestamp: e, data: t });
548
+ }
549
+ break;
550
+ case "video":
551
+ {
552
+ const { type: r, dts: i, data: t, nalus: e = [] } = a;
553
+ if (this.renderBaseTime === void 0) {
554
+ const l = (/* @__PURE__ */ new Date()).getTime();
555
+ this.renderBaseTime = l - i, (n = this.renderWorker) == null || n.setBaseTime(this.renderBaseTime);
556
+ }
557
+ const s = i * 1e3;
558
+ this.decoderWorker.video.decode({ type: r, timestamp: s, data: t });
559
+ for (const l of e) {
560
+ if (l.byteLength <= 4) continue;
561
+ const { header: c, data: d } = Y(l), { nal_unit_type: y } = c;
562
+ y === 6 && this.on.demuxer.sei && this.on.demuxer.sei(d);
563
+ }
564
+ }
565
+ break;
566
+ }
567
+ };
429
568
  });
430
569
  /**
431
570
  * 初始化解码器
432
571
  */
433
- v(this, "initDecoder", () => {
434
- this.decoderWorker = new j(), this.decoderWorker.on.audio.decode = (o) => {
435
- var u;
436
- (u = this.audioPlayer) == null || u.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
572
+ m(this, "initDecoder", () => {
573
+ this.decoderWorker = new N(), this.decoderWorker.on.audio.decode = (o) => {
574
+ var a;
575
+ (a = this.audioPlayer) == null || a.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
437
576
  }, this.decoderWorker.on.audio.error = (o) => {
438
577
  this.stop(), this.on.error && this.on.error(o);
439
578
  }, this.decoderWorker.on.video.decode = async (o) => {
440
- var c, r;
441
- (c = this.renderWorker) == null || c.push(o);
442
- const u = [...this.cutRenders.keys()];
443
- for (const n of u)
444
- (r = this.cutRenders.get(n)) == null || r.worker.push(o);
579
+ var u, n;
580
+ (u = this.renderWorker) == null || u.push(o);
581
+ const a = [...this.cutRenders.keys()];
582
+ for (const r of a)
583
+ (n = this.cutRenders.get(r)) == null || n.worker.push(o);
445
584
  this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
446
585
  }, this.decoderWorker.on.video.error = (o) => {
447
586
  this.stop(), this.on.error && this.on.error(o);
@@ -450,89 +589,104 @@ class be {
450
589
  /**
451
590
  * 初始化渲染器
452
591
  */
453
- v(this, "initRender", () => {
454
- const { worker: o, canvas: u, stream: c } = G(this.renderBaseTime);
455
- this.renderWorker = o, this.canvas = u, this.stream = c, this.renderWorker.setPause(!1);
456
- });
457
- v(this, "getCanvas", () => this.canvas);
458
- v(this, "getStream", () => this.stream);
459
- v(this, "getCutCanvas", (o) => {
460
- var u;
461
- return (u = this.cutRenders.get(o)) == null ? void 0 : u.canvas;
462
- });
463
- v(this, "getCutStream", (o) => {
464
- var u;
465
- return (u = this.cutRenders.get(o)) == null ? void 0 : u.stream;
466
- });
467
- v(this, "setPause", (o) => {
468
- var u;
469
- (u = this.renderWorker) == null || u.setPause(o);
470
- });
471
- /**
472
- * 设置渲染模式
473
- */
474
- v(this, "setShader", (o) => {
475
- var u;
476
- (u = this.renderWorker) == null || u.setShader(o);
592
+ m(this, "initRender", () => {
593
+ const { worker: o, canvas: a, stream: u } = A();
594
+ this.renderWorker = o, this.canvas = a, this.stream = u, this.renderWorker.setPause(!1);
477
595
  });
478
- /**
479
- * 是否静音 默认为true
480
- * @param state?: boolean
481
- */
482
- v(this, "setMute", (o) => {
483
- var u, c;
484
- return (c = (u = this.audioPlayer) == null ? void 0 : u.prAudioStream) == null ? void 0 : c.setMute(o);
596
+ m(this, "flv", {
597
+ start: async () => {
598
+ var o, a;
599
+ try {
600
+ const u = (o = (await this.prFetch.request(this.url)).body) == null ? void 0 : o.getReader();
601
+ if (!u) throw new Error("reader is error.");
602
+ for (; ; ) {
603
+ const { done: n, value: r } = await u.read();
604
+ if (r && ((a = this.demuxerWorker) == null || a.push(r)), n) break;
605
+ }
606
+ } catch (u) {
607
+ if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
608
+ }
609
+ }
485
610
  });
486
- v(this, "cut", {
487
- /**
488
- * 创建剪切
489
- */
490
- create: (o, u) => {
491
- let c = this.cutRenders.get(o);
492
- return c ? (c.worker.setCut(u), c.worker.setPause(!1), c) : (c = G(this.renderBaseTime), c.worker.setCut(u), this.cutRenders.set(o, c), c);
611
+ m(this, "hls", {
612
+ isLive: !1,
613
+ urls: [],
614
+ url: "",
615
+ getSegmentsTimer: 0,
616
+ parse: async (o) => {
617
+ const a = new TextDecoder("utf-8").decode(o).split(`
618
+ `).map((e) => e.replace("\r", "")), u = this.url.substring(0, this.url.lastIndexOf("/") + 1);
619
+ let n = 4, r = 0, i = !1;
620
+ const t = [];
621
+ for (const e of a)
622
+ e.startsWith("#EXTINF:") ? n = parseFloat(e.split(":")[1].split(",")[0]) : e.startsWith("#EXT-X-TARGETDURATION:") ? r = parseInt(e.split(":")[1]) : e.startsWith("#EXT-X-ENDLIST") ? i = !1 : e.startsWith("#EXT-X-MEDIA-SEQUENCE:") ? i = !0 : e.includes(".ts") && !e.startsWith("#") && t.push({
623
+ url: e.startsWith("http") ? e : u + e,
624
+ duration: n,
625
+ isLive: i
626
+ });
627
+ return { baseUrl: u, targetDuration: r, isLive: i, segments: t };
493
628
  },
494
- setPause: (o, u) => {
495
- var c;
496
- (c = this.cutRenders.get(o)) == null || c.worker.setPause(u);
629
+ getSegments: async () => {
630
+ var a;
631
+ const o = (a = (await new C().request(this.url)).body) == null ? void 0 : a.getReader();
632
+ if (!o) throw new Error("reader is error.");
633
+ for (; ; ) {
634
+ const { done: u, value: n } = await o.read();
635
+ if (n) {
636
+ const r = await this.hls.parse(n), { segments: i = [], isLive: t = !1 } = r;
637
+ this.hls.isLive = t;
638
+ let e = Array.from(i, (l) => l.url);
639
+ const s = e.findIndex((l) => l === this.hls.url);
640
+ s !== -1 && (e = e.slice(s + 1)), this.hls.urls = e;
641
+ }
642
+ if (u) break;
643
+ }
497
644
  },
498
- /**
499
- * 设置渲染模式
500
- */
501
- setShader: (o, u) => {
502
- var c;
503
- (c = this.cutRenders.get(o)) == null || c.worker.setShader(u);
645
+ getData: async () => {
504
646
  },
505
- /**
506
- * 移除剪切
507
- */
508
- remove: (o) => {
509
- var u;
510
- (u = this.cutRenders.get(o)) == null || u.destroy(), this.cutRenders.delete(o);
647
+ start: async () => {
648
+ var o, a;
649
+ try {
650
+ for (await this.hls.getSegments(), this.hls.getSegmentsTimer = window.setInterval(this.hls.getSegments, 1e3), this.hls.isLive === !1 && clearInterval(this.hls.getSegmentsTimer); ; ) {
651
+ const u = this.hls.urls.shift();
652
+ if (u) {
653
+ this.hls.url = u;
654
+ const n = (o = (await this.prFetch.request(u)).body) == null ? void 0 : o.getReader();
655
+ if (!n) throw new Error("segment reader is error.");
656
+ for (; ; ) {
657
+ const { done: r, value: i } = await n.read();
658
+ if (i && ((a = this.demuxerWorker) == null || a.push(i)), r) break;
659
+ }
660
+ }
661
+ await new Promise((n) => setTimeout(() => n(!0), 500));
662
+ }
663
+ } catch (u) {
664
+ if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
665
+ }
511
666
  }
512
667
  });
513
668
  }
514
669
  }
515
- new TextDecoder("utf-8");
516
670
  var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, indexMinimal = {}, minimal$1 = {}, aspromise, hasRequiredAspromise;
517
671
  function requireAspromise() {
518
672
  if (hasRequiredAspromise) return aspromise;
519
- hasRequiredAspromise = 1, aspromise = f;
520
- function f(o, u) {
521
- for (var c = new Array(arguments.length - 1), r = 0, n = 2, i = !0; n < arguments.length; )
522
- c[r++] = arguments[n++];
523
- return new Promise(function(t, s) {
524
- c[r] = function(a) {
673
+ hasRequiredAspromise = 1, aspromise = h;
674
+ function h(o, a) {
675
+ for (var u = new Array(arguments.length - 1), n = 0, r = 2, i = !0; r < arguments.length; )
676
+ u[n++] = arguments[r++];
677
+ return new Promise(function(e, s) {
678
+ u[n] = function(c) {
525
679
  if (i)
526
- if (i = !1, a)
527
- s(a);
680
+ if (i = !1, c)
681
+ s(c);
528
682
  else {
529
683
  for (var d = new Array(arguments.length - 1), y = 0; y < d.length; )
530
684
  d[y++] = arguments[y];
531
- t.apply(null, d);
685
+ e.apply(null, d);
532
686
  }
533
687
  };
534
688
  try {
535
- o.apply(u || null, c);
689
+ o.apply(a || null, u);
536
690
  } catch (l) {
537
691
  i && (i = !1, s(l));
538
692
  }
@@ -542,95 +696,95 @@ function requireAspromise() {
542
696
  }
543
697
  var base64 = {}, hasRequiredBase64;
544
698
  function requireBase64() {
545
- return hasRequiredBase64 || (hasRequiredBase64 = 1, function(f) {
546
- var o = f;
547
- o.length = function(e) {
548
- var t = e.length;
549
- if (!t)
699
+ return hasRequiredBase64 || (hasRequiredBase64 = 1, function(h) {
700
+ var o = h;
701
+ o.length = function(t) {
702
+ var e = t.length;
703
+ if (!e)
550
704
  return 0;
551
- for (var s = 0; --t % 4 > 1 && e.charAt(t) === "="; )
705
+ for (var s = 0; --e % 4 > 1 && t.charAt(e) === "="; )
552
706
  ++s;
553
- return Math.ceil(e.length * 3) / 4 - s;
707
+ return Math.ceil(t.length * 3) / 4 - s;
554
708
  };
555
- for (var u = new Array(64), c = new Array(123), r = 0; r < 64; )
556
- c[u[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
557
- o.encode = function(e, t, s) {
558
- for (var l = null, a = [], d = 0, y = 0, p; t < s; ) {
559
- var w = e[t++];
709
+ for (var a = new Array(64), u = new Array(123), n = 0; n < 64; )
710
+ u[a[n] = n < 26 ? n + 65 : n < 52 ? n + 71 : n < 62 ? n - 4 : n - 59 | 43] = n++;
711
+ o.encode = function(t, e, s) {
712
+ for (var l = null, c = [], d = 0, y = 0, p; e < s; ) {
713
+ var w = t[e++];
560
714
  switch (y) {
561
715
  case 0:
562
- a[d++] = u[w >> 2], p = (w & 3) << 4, y = 1;
716
+ c[d++] = a[w >> 2], p = (w & 3) << 4, y = 1;
563
717
  break;
564
718
  case 1:
565
- a[d++] = u[p | w >> 4], p = (w & 15) << 2, y = 2;
719
+ c[d++] = a[p | w >> 4], p = (w & 15) << 2, y = 2;
566
720
  break;
567
721
  case 2:
568
- a[d++] = u[p | w >> 6], a[d++] = u[w & 63], y = 0;
722
+ c[d++] = a[p | w >> 6], c[d++] = a[w & 63], y = 0;
569
723
  break;
570
724
  }
571
- d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, a)), d = 0);
725
+ d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, c)), d = 0);
572
726
  }
573
- return y && (a[d++] = u[p], a[d++] = 61, y === 1 && (a[d++] = 61)), l ? (d && l.push(String.fromCharCode.apply(String, a.slice(0, d))), l.join("")) : String.fromCharCode.apply(String, a.slice(0, d));
727
+ return y && (c[d++] = a[p], c[d++] = 61, y === 1 && (c[d++] = 61)), l ? (d && l.push(String.fromCharCode.apply(String, c.slice(0, d))), l.join("")) : String.fromCharCode.apply(String, c.slice(0, d));
574
728
  };
575
- var n = "invalid encoding";
576
- o.decode = function(e, t, s) {
577
- for (var l = s, a = 0, d, y = 0; y < e.length; ) {
578
- var p = e.charCodeAt(y++);
579
- if (p === 61 && a > 1)
729
+ var r = "invalid encoding";
730
+ o.decode = function(t, e, s) {
731
+ for (var l = s, c = 0, d, y = 0; y < t.length; ) {
732
+ var p = t.charCodeAt(y++);
733
+ if (p === 61 && c > 1)
580
734
  break;
581
- if ((p = c[p]) === void 0)
582
- throw Error(n);
583
- switch (a) {
735
+ if ((p = u[p]) === void 0)
736
+ throw Error(r);
737
+ switch (c) {
584
738
  case 0:
585
- d = p, a = 1;
739
+ d = p, c = 1;
586
740
  break;
587
741
  case 1:
588
- t[s++] = d << 2 | (p & 48) >> 4, d = p, a = 2;
742
+ e[s++] = d << 2 | (p & 48) >> 4, d = p, c = 2;
589
743
  break;
590
744
  case 2:
591
- t[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, a = 3;
745
+ e[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, c = 3;
592
746
  break;
593
747
  case 3:
594
- t[s++] = (d & 3) << 6 | p, a = 0;
748
+ e[s++] = (d & 3) << 6 | p, c = 0;
595
749
  break;
596
750
  }
597
751
  }
598
- if (a === 1)
599
- throw Error(n);
752
+ if (c === 1)
753
+ throw Error(r);
600
754
  return s - l;
601
- }, o.test = function(e) {
602
- return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e);
755
+ }, o.test = function(t) {
756
+ return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t);
603
757
  };
604
758
  }(base64)), base64;
605
759
  }
606
760
  var eventemitter, hasRequiredEventemitter;
607
761
  function requireEventemitter() {
608
762
  if (hasRequiredEventemitter) return eventemitter;
609
- hasRequiredEventemitter = 1, eventemitter = f;
610
- function f() {
763
+ hasRequiredEventemitter = 1, eventemitter = h;
764
+ function h() {
611
765
  this._listeners = {};
612
766
  }
613
- return f.prototype.on = function(u, c, r) {
614
- return (this._listeners[u] || (this._listeners[u] = [])).push({
615
- fn: c,
616
- ctx: r || this
767
+ return h.prototype.on = function(a, u, n) {
768
+ return (this._listeners[a] || (this._listeners[a] = [])).push({
769
+ fn: u,
770
+ ctx: n || this
617
771
  }), this;
618
- }, f.prototype.off = function(u, c) {
619
- if (u === void 0)
772
+ }, h.prototype.off = function(a, u) {
773
+ if (a === void 0)
620
774
  this._listeners = {};
621
- else if (c === void 0)
622
- this._listeners[u] = [];
775
+ else if (u === void 0)
776
+ this._listeners[a] = [];
623
777
  else
624
- for (var r = this._listeners[u], n = 0; n < r.length; )
625
- r[n].fn === c ? r.splice(n, 1) : ++n;
778
+ for (var n = this._listeners[a], r = 0; r < n.length; )
779
+ n[r].fn === u ? n.splice(r, 1) : ++r;
626
780
  return this;
627
- }, f.prototype.emit = function(u) {
628
- var c = this._listeners[u];
629
- if (c) {
630
- for (var r = [], n = 1; n < arguments.length; )
631
- r.push(arguments[n++]);
632
- for (n = 0; n < c.length; )
633
- c[n].fn.apply(c[n++].ctx, r);
781
+ }, h.prototype.emit = function(a) {
782
+ var u = this._listeners[a];
783
+ if (u) {
784
+ for (var n = [], r = 1; r < arguments.length; )
785
+ n.push(arguments[r++]);
786
+ for (r = 0; r < u.length; )
787
+ u[r].fn.apply(u[r++].ctx, n);
634
788
  }
635
789
  return this;
636
790
  }, eventemitter;
@@ -638,112 +792,112 @@ function requireEventemitter() {
638
792
  var float, hasRequiredFloat;
639
793
  function requireFloat() {
640
794
  if (hasRequiredFloat) return float;
641
- hasRequiredFloat = 1, float = f(f);
642
- function f(n) {
795
+ hasRequiredFloat = 1, float = h(h);
796
+ function h(r) {
643
797
  return typeof Float32Array < "u" ? function() {
644
- var i = new Float32Array([-0]), e = new Uint8Array(i.buffer), t = e[3] === 128;
798
+ var i = new Float32Array([-0]), t = new Uint8Array(i.buffer), e = t[3] === 128;
645
799
  function s(y, p, w) {
646
- i[0] = y, p[w] = e[0], p[w + 1] = e[1], p[w + 2] = e[2], p[w + 3] = e[3];
800
+ i[0] = y, p[w] = t[0], p[w + 1] = t[1], p[w + 2] = t[2], p[w + 3] = t[3];
647
801
  }
648
802
  function l(y, p, w) {
649
- i[0] = y, p[w] = e[3], p[w + 1] = e[2], p[w + 2] = e[1], p[w + 3] = e[0];
803
+ i[0] = y, p[w] = t[3], p[w + 1] = t[2], p[w + 2] = t[1], p[w + 3] = t[0];
650
804
  }
651
- n.writeFloatLE = t ? s : l, n.writeFloatBE = t ? l : s;
652
- function a(y, p) {
653
- return e[0] = y[p], e[1] = y[p + 1], e[2] = y[p + 2], e[3] = y[p + 3], i[0];
805
+ r.writeFloatLE = e ? s : l, r.writeFloatBE = e ? l : s;
806
+ function c(y, p) {
807
+ return t[0] = y[p], t[1] = y[p + 1], t[2] = y[p + 2], t[3] = y[p + 3], i[0];
654
808
  }
655
809
  function d(y, p) {
656
- return e[3] = y[p], e[2] = y[p + 1], e[1] = y[p + 2], e[0] = y[p + 3], i[0];
810
+ return t[3] = y[p], t[2] = y[p + 1], t[1] = y[p + 2], t[0] = y[p + 3], i[0];
657
811
  }
658
- n.readFloatLE = t ? a : d, n.readFloatBE = t ? d : a;
812
+ r.readFloatLE = e ? c : d, r.readFloatBE = e ? d : c;
659
813
  }() : function() {
660
- function i(t, s, l, a) {
814
+ function i(e, s, l, c) {
661
815
  var d = s < 0 ? 1 : 0;
662
816
  if (d && (s = -s), s === 0)
663
- t(1 / s > 0 ? (
817
+ e(1 / s > 0 ? (
664
818
  /* positive */
665
819
  0
666
820
  ) : (
667
821
  /* negative 0 */
668
822
  2147483648
669
- ), l, a);
823
+ ), l, c);
670
824
  else if (isNaN(s))
671
- t(2143289344, l, a);
825
+ e(2143289344, l, c);
672
826
  else if (s > 34028234663852886e22)
673
- t((d << 31 | 2139095040) >>> 0, l, a);
827
+ e((d << 31 | 2139095040) >>> 0, l, c);
674
828
  else if (s < 11754943508222875e-54)
675
- t((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, a);
829
+ e((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, c);
676
830
  else {
677
831
  var y = Math.floor(Math.log(s) / Math.LN2), p = Math.round(s * Math.pow(2, -y) * 8388608) & 8388607;
678
- t((d << 31 | y + 127 << 23 | p) >>> 0, l, a);
832
+ e((d << 31 | y + 127 << 23 | p) >>> 0, l, c);
679
833
  }
680
834
  }
681
- n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null, u);
682
- function e(t, s, l) {
683
- var a = t(s, l), d = (a >> 31) * 2 + 1, y = a >>> 23 & 255, p = a & 8388607;
835
+ r.writeFloatLE = i.bind(null, o), r.writeFloatBE = i.bind(null, a);
836
+ function t(e, s, l) {
837
+ var c = e(s, l), d = (c >> 31) * 2 + 1, y = c >>> 23 & 255, p = c & 8388607;
684
838
  return y === 255 ? p ? NaN : d * (1 / 0) : y === 0 ? d * 1401298464324817e-60 * p : d * Math.pow(2, y - 150) * (p + 8388608);
685
839
  }
686
- n.readFloatLE = e.bind(null, c), n.readFloatBE = e.bind(null, r);
840
+ r.readFloatLE = t.bind(null, u), r.readFloatBE = t.bind(null, n);
687
841
  }(), typeof Float64Array < "u" ? function() {
688
- var i = new Float64Array([-0]), e = new Uint8Array(i.buffer), t = e[7] === 128;
842
+ var i = new Float64Array([-0]), t = new Uint8Array(i.buffer), e = t[7] === 128;
689
843
  function s(y, p, w) {
690
- i[0] = y, p[w] = e[0], p[w + 1] = e[1], p[w + 2] = e[2], p[w + 3] = e[3], p[w + 4] = e[4], p[w + 5] = e[5], p[w + 6] = e[6], p[w + 7] = e[7];
844
+ i[0] = y, p[w] = t[0], p[w + 1] = t[1], p[w + 2] = t[2], p[w + 3] = t[3], p[w + 4] = t[4], p[w + 5] = t[5], p[w + 6] = t[6], p[w + 7] = t[7];
691
845
  }
692
846
  function l(y, p, w) {
693
- i[0] = y, p[w] = e[7], p[w + 1] = e[6], p[w + 2] = e[5], p[w + 3] = e[4], p[w + 4] = e[3], p[w + 5] = e[2], p[w + 6] = e[1], p[w + 7] = e[0];
847
+ i[0] = y, p[w] = t[7], p[w + 1] = t[6], p[w + 2] = t[5], p[w + 3] = t[4], p[w + 4] = t[3], p[w + 5] = t[2], p[w + 6] = t[1], p[w + 7] = t[0];
694
848
  }
695
- n.writeDoubleLE = t ? s : l, n.writeDoubleBE = t ? l : s;
696
- function a(y, p) {
697
- return e[0] = y[p], e[1] = y[p + 1], e[2] = y[p + 2], e[3] = y[p + 3], e[4] = y[p + 4], e[5] = y[p + 5], e[6] = y[p + 6], e[7] = y[p + 7], i[0];
849
+ r.writeDoubleLE = e ? s : l, r.writeDoubleBE = e ? l : s;
850
+ function c(y, p) {
851
+ return t[0] = y[p], t[1] = y[p + 1], t[2] = y[p + 2], t[3] = y[p + 3], t[4] = y[p + 4], t[5] = y[p + 5], t[6] = y[p + 6], t[7] = y[p + 7], i[0];
698
852
  }
699
853
  function d(y, p) {
700
- return e[7] = y[p], e[6] = y[p + 1], e[5] = y[p + 2], e[4] = y[p + 3], e[3] = y[p + 4], e[2] = y[p + 5], e[1] = y[p + 6], e[0] = y[p + 7], i[0];
854
+ return t[7] = y[p], t[6] = y[p + 1], t[5] = y[p + 2], t[4] = y[p + 3], t[3] = y[p + 4], t[2] = y[p + 5], t[1] = y[p + 6], t[0] = y[p + 7], i[0];
701
855
  }
702
- n.readDoubleLE = t ? a : d, n.readDoubleBE = t ? d : a;
856
+ r.readDoubleLE = e ? c : d, r.readDoubleBE = e ? d : c;
703
857
  }() : function() {
704
- function i(t, s, l, a, d, y) {
705
- var p = a < 0 ? 1 : 0;
706
- if (p && (a = -a), a === 0)
707
- t(0, d, y + s), t(1 / a > 0 ? (
858
+ function i(e, s, l, c, d, y) {
859
+ var p = c < 0 ? 1 : 0;
860
+ if (p && (c = -c), c === 0)
861
+ e(0, d, y + s), e(1 / c > 0 ? (
708
862
  /* positive */
709
863
  0
710
864
  ) : (
711
865
  /* negative 0 */
712
866
  2147483648
713
867
  ), d, y + l);
714
- else if (isNaN(a))
715
- t(0, d, y + s), t(2146959360, d, y + l);
716
- else if (a > 17976931348623157e292)
717
- t(0, d, y + s), t((p << 31 | 2146435072) >>> 0, d, y + l);
868
+ else if (isNaN(c))
869
+ e(0, d, y + s), e(2146959360, d, y + l);
870
+ else if (c > 17976931348623157e292)
871
+ e(0, d, y + s), e((p << 31 | 2146435072) >>> 0, d, y + l);
718
872
  else {
719
873
  var w;
720
- if (a < 22250738585072014e-324)
721
- w = a / 5e-324, t(w >>> 0, d, y + s), t((p << 31 | w / 4294967296) >>> 0, d, y + l);
874
+ if (c < 22250738585072014e-324)
875
+ w = c / 5e-324, e(w >>> 0, d, y + s), e((p << 31 | w / 4294967296) >>> 0, d, y + l);
722
876
  else {
723
- var b = Math.floor(Math.log(a) / Math.LN2);
724
- b === 1024 && (b = 1023), w = a * Math.pow(2, -b), t(w * 4503599627370496 >>> 0, d, y + s), t((p << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, y + l);
877
+ var b = Math.floor(Math.log(c) / Math.LN2);
878
+ b === 1024 && (b = 1023), w = c * Math.pow(2, -b), e(w * 4503599627370496 >>> 0, d, y + s), e((p << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, y + l);
725
879
  }
726
880
  }
727
881
  }
728
- n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null, u, 4, 0);
729
- function e(t, s, l, a, d) {
730
- var y = t(a, d + s), p = t(a, d + l), w = (p >> 31) * 2 + 1, b = p >>> 20 & 2047, m = 4294967296 * (p & 1048575) + y;
731
- return b === 2047 ? m ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * m : w * Math.pow(2, b - 1075) * (m + 4503599627370496);
882
+ r.writeDoubleLE = i.bind(null, o, 0, 4), r.writeDoubleBE = i.bind(null, a, 4, 0);
883
+ function t(e, s, l, c, d) {
884
+ var y = e(c, d + s), p = e(c, d + l), w = (p >> 31) * 2 + 1, b = p >>> 20 & 2047, g = 4294967296 * (p & 1048575) + y;
885
+ return b === 2047 ? g ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * g : w * Math.pow(2, b - 1075) * (g + 4503599627370496);
732
886
  }
733
- n.readDoubleLE = e.bind(null, c, 0, 4), n.readDoubleBE = e.bind(null, r, 4, 0);
734
- }(), n;
887
+ r.readDoubleLE = t.bind(null, u, 0, 4), r.readDoubleBE = t.bind(null, n, 4, 0);
888
+ }(), r;
735
889
  }
736
- function o(n, i, e) {
737
- i[e] = n & 255, i[e + 1] = n >>> 8 & 255, i[e + 2] = n >>> 16 & 255, i[e + 3] = n >>> 24;
890
+ function o(r, i, t) {
891
+ i[t] = r & 255, i[t + 1] = r >>> 8 & 255, i[t + 2] = r >>> 16 & 255, i[t + 3] = r >>> 24;
738
892
  }
739
- function u(n, i, e) {
740
- i[e] = n >>> 24, i[e + 1] = n >>> 16 & 255, i[e + 2] = n >>> 8 & 255, i[e + 3] = n & 255;
893
+ function a(r, i, t) {
894
+ i[t] = r >>> 24, i[t + 1] = r >>> 16 & 255, i[t + 2] = r >>> 8 & 255, i[t + 3] = r & 255;
741
895
  }
742
- function c(n, i) {
743
- return (n[i] | n[i + 1] << 8 | n[i + 2] << 16 | n[i + 3] << 24) >>> 0;
896
+ function u(r, i) {
897
+ return (r[i] | r[i + 1] << 8 | r[i + 2] << 16 | r[i + 3] << 24) >>> 0;
744
898
  }
745
- function r(n, i) {
746
- return (n[i] << 24 | n[i + 1] << 16 | n[i + 2] << 8 | n[i + 3]) >>> 0;
899
+ function n(r, i) {
900
+ return (r[i] << 24 | r[i + 1] << 16 | r[i + 2] << 8 | r[i + 3]) >>> 0;
747
901
  }
748
902
  return float;
749
903
  }
@@ -756,7 +910,7 @@ function requireInquire() {
756
910
  var mod = eval("quire".replace(/^/, "re"))(moduleName);
757
911
  if (mod && (mod.length || Object.keys(mod).length))
758
912
  return mod;
759
- } catch (f) {
913
+ } catch (h) {
760
914
  }
761
915
  return null;
762
916
  }
@@ -764,38 +918,38 @@ function requireInquire() {
764
918
  }
765
919
  var utf8 = {}, hasRequiredUtf8;
766
920
  function requireUtf8() {
767
- return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(f) {
768
- var o = f;
769
- o.length = function(c) {
770
- for (var r = 0, n = 0, i = 0; i < c.length; ++i)
771
- n = c.charCodeAt(i), n < 128 ? r += 1 : n < 2048 ? r += 2 : (n & 64512) === 55296 && (c.charCodeAt(i + 1) & 64512) === 56320 ? (++i, r += 4) : r += 3;
772
- return r;
773
- }, o.read = function(c, r, n) {
774
- var i = n - r;
921
+ return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(h) {
922
+ var o = h;
923
+ o.length = function(u) {
924
+ for (var n = 0, r = 0, i = 0; i < u.length; ++i)
925
+ r = u.charCodeAt(i), r < 128 ? n += 1 : r < 2048 ? n += 2 : (r & 64512) === 55296 && (u.charCodeAt(i + 1) & 64512) === 56320 ? (++i, n += 4) : n += 3;
926
+ return n;
927
+ }, o.read = function(u, n, r) {
928
+ var i = r - n;
775
929
  if (i < 1)
776
930
  return "";
777
- for (var e = null, t = [], s = 0, l; r < n; )
778
- l = c[r++], l < 128 ? t[s++] = l : l > 191 && l < 224 ? t[s++] = (l & 31) << 6 | c[r++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (c[r++] & 63) << 12 | (c[r++] & 63) << 6 | c[r++] & 63) - 65536, t[s++] = 55296 + (l >> 10), t[s++] = 56320 + (l & 1023)) : t[s++] = (l & 15) << 12 | (c[r++] & 63) << 6 | c[r++] & 63, s > 8191 && ((e || (e = [])).push(String.fromCharCode.apply(String, t)), s = 0);
779
- return e ? (s && e.push(String.fromCharCode.apply(String, t.slice(0, s))), e.join("")) : String.fromCharCode.apply(String, t.slice(0, s));
780
- }, o.write = function(c, r, n) {
781
- for (var i = n, e, t, s = 0; s < c.length; ++s)
782
- e = c.charCodeAt(s), e < 128 ? r[n++] = e : e < 2048 ? (r[n++] = e >> 6 | 192, r[n++] = e & 63 | 128) : (e & 64512) === 55296 && ((t = c.charCodeAt(s + 1)) & 64512) === 56320 ? (e = 65536 + ((e & 1023) << 10) + (t & 1023), ++s, r[n++] = e >> 18 | 240, r[n++] = e >> 12 & 63 | 128, r[n++] = e >> 6 & 63 | 128, r[n++] = e & 63 | 128) : (r[n++] = e >> 12 | 224, r[n++] = e >> 6 & 63 | 128, r[n++] = e & 63 | 128);
783
- return n - i;
931
+ for (var t = null, e = [], s = 0, l; n < r; )
932
+ l = u[n++], l < 128 ? e[s++] = l : l > 191 && l < 224 ? e[s++] = (l & 31) << 6 | u[n++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (u[n++] & 63) << 12 | (u[n++] & 63) << 6 | u[n++] & 63) - 65536, e[s++] = 55296 + (l >> 10), e[s++] = 56320 + (l & 1023)) : e[s++] = (l & 15) << 12 | (u[n++] & 63) << 6 | u[n++] & 63, s > 8191 && ((t || (t = [])).push(String.fromCharCode.apply(String, e)), s = 0);
933
+ return t ? (s && t.push(String.fromCharCode.apply(String, e.slice(0, s))), t.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
934
+ }, o.write = function(u, n, r) {
935
+ for (var i = r, t, e, s = 0; s < u.length; ++s)
936
+ t = u.charCodeAt(s), t < 128 ? n[r++] = t : t < 2048 ? (n[r++] = t >> 6 | 192, n[r++] = t & 63 | 128) : (t & 64512) === 55296 && ((e = u.charCodeAt(s + 1)) & 64512) === 56320 ? (t = 65536 + ((t & 1023) << 10) + (e & 1023), ++s, n[r++] = t >> 18 | 240, n[r++] = t >> 12 & 63 | 128, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128) : (n[r++] = t >> 12 | 224, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128);
937
+ return r - i;
784
938
  };
785
939
  }(utf8)), utf8;
786
940
  }
787
941
  var pool_1, hasRequiredPool;
788
942
  function requirePool() {
789
943
  if (hasRequiredPool) return pool_1;
790
- hasRequiredPool = 1, pool_1 = f;
791
- function f(o, u, c) {
792
- var r = c || 8192, n = r >>> 1, i = null, e = r;
944
+ hasRequiredPool = 1, pool_1 = h;
945
+ function h(o, a, u) {
946
+ var n = u || 8192, r = n >>> 1, i = null, t = n;
793
947
  return function(s) {
794
- if (s < 1 || s > n)
948
+ if (s < 1 || s > r)
795
949
  return o(s);
796
- e + s > r && (i = o(r), e = 0);
797
- var l = u.call(i, e, e += s);
798
- return e & 7 && (e = (e | 7) + 1), l;
950
+ t + s > n && (i = o(n), t = 0);
951
+ var l = a.call(i, t, t += s);
952
+ return t & 7 && (t = (t | 7) + 1), l;
799
953
  };
800
954
  }
801
955
  return pool_1;
@@ -804,49 +958,49 @@ var longbits, hasRequiredLongbits;
804
958
  function requireLongbits() {
805
959
  if (hasRequiredLongbits) return longbits;
806
960
  hasRequiredLongbits = 1, longbits = o;
807
- var f = requireMinimal$1();
808
- function o(n, i) {
809
- this.lo = n >>> 0, this.hi = i >>> 0;
961
+ var h = requireMinimal$1();
962
+ function o(r, i) {
963
+ this.lo = r >>> 0, this.hi = i >>> 0;
810
964
  }
811
- var u = o.zero = new o(0, 0);
812
- u.toNumber = function() {
965
+ var a = o.zero = new o(0, 0);
966
+ a.toNumber = function() {
813
967
  return 0;
814
- }, u.zzEncode = u.zzDecode = function() {
968
+ }, a.zzEncode = a.zzDecode = function() {
815
969
  return this;
816
- }, u.length = function() {
970
+ }, a.length = function() {
817
971
  return 1;
818
972
  };
819
- var c = o.zeroHash = "\0\0\0\0\0\0\0\0";
973
+ var u = o.zeroHash = "\0\0\0\0\0\0\0\0";
820
974
  o.fromNumber = function(i) {
821
975
  if (i === 0)
822
- return u;
823
- var e = i < 0;
824
- e && (i = -i);
825
- var t = i >>> 0, s = (i - t) / 4294967296 >>> 0;
826
- return e && (s = ~s >>> 0, t = ~t >>> 0, ++t > 4294967295 && (t = 0, ++s > 4294967295 && (s = 0))), new o(t, s);
976
+ return a;
977
+ var t = i < 0;
978
+ t && (i = -i);
979
+ var e = i >>> 0, s = (i - e) / 4294967296 >>> 0;
980
+ return t && (s = ~s >>> 0, e = ~e >>> 0, ++e > 4294967295 && (e = 0, ++s > 4294967295 && (s = 0))), new o(e, s);
827
981
  }, o.from = function(i) {
828
982
  if (typeof i == "number")
829
983
  return o.fromNumber(i);
830
- if (f.isString(i))
831
- if (f.Long)
832
- i = f.Long.fromString(i);
984
+ if (h.isString(i))
985
+ if (h.Long)
986
+ i = h.Long.fromString(i);
833
987
  else
834
988
  return o.fromNumber(parseInt(i, 10));
835
- return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : u;
989
+ return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : a;
836
990
  }, o.prototype.toNumber = function(i) {
837
991
  if (!i && this.hi >>> 31) {
838
- var e = ~this.lo + 1 >>> 0, t = ~this.hi >>> 0;
839
- return e || (t = t + 1 >>> 0), -(e + t * 4294967296);
992
+ var t = ~this.lo + 1 >>> 0, e = ~this.hi >>> 0;
993
+ return t || (e = e + 1 >>> 0), -(t + e * 4294967296);
840
994
  }
841
995
  return this.lo + this.hi * 4294967296;
842
996
  }, o.prototype.toLong = function(i) {
843
- return f.Long ? new f.Long(this.lo | 0, this.hi | 0, !!i) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!i };
997
+ return h.Long ? new h.Long(this.lo | 0, this.hi | 0, !!i) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!i };
844
998
  };
845
- var r = String.prototype.charCodeAt;
999
+ var n = String.prototype.charCodeAt;
846
1000
  return o.fromHash = function(i) {
847
- return i === c ? u : new o(
848
- (r.call(i, 0) | r.call(i, 1) << 8 | r.call(i, 2) << 16 | r.call(i, 3) << 24) >>> 0,
849
- (r.call(i, 4) | r.call(i, 5) << 8 | r.call(i, 6) << 16 | r.call(i, 7) << 24) >>> 0
1001
+ return i === u ? a : new o(
1002
+ (n.call(i, 0) | n.call(i, 1) << 8 | n.call(i, 2) << 16 | n.call(i, 3) << 24) >>> 0,
1003
+ (n.call(i, 4) | n.call(i, 5) << 8 | n.call(i, 6) << 16 | n.call(i, 7) << 24) >>> 0
850
1004
  );
851
1005
  }, o.prototype.toHash = function() {
852
1006
  return String.fromCharCode(
@@ -866,14 +1020,14 @@ function requireLongbits() {
866
1020
  var i = -(this.lo & 1);
867
1021
  return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ i) >>> 0, this.hi = (this.hi >>> 1 ^ i) >>> 0, this;
868
1022
  }, o.prototype.length = function() {
869
- var i = this.lo, e = (this.lo >>> 28 | this.hi << 4) >>> 0, t = this.hi >>> 24;
870
- return t === 0 ? e === 0 ? i < 16384 ? i < 128 ? 1 : 2 : i < 2097152 ? 3 : 4 : e < 16384 ? e < 128 ? 5 : 6 : e < 2097152 ? 7 : 8 : t < 128 ? 9 : 10;
1023
+ var i = this.lo, t = (this.lo >>> 28 | this.hi << 4) >>> 0, e = this.hi >>> 24;
1024
+ return e === 0 ? t === 0 ? i < 16384 ? i < 128 ? 1 : 2 : i < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : e < 128 ? 9 : 10;
871
1025
  }, longbits;
872
1026
  }
873
1027
  var hasRequiredMinimal$1;
874
1028
  function requireMinimal$1() {
875
- return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(f) {
876
- var o = f;
1029
+ return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(h) {
1030
+ var o = h;
877
1031
  o.asPromise = requireAspromise(), o.base64 = requireBase64(), o.EventEmitter = requireEventemitter(), o.float = requireFloat(), o.inquire = requireInquire(), o.utf8 = requireUtf8(), o.pool = requirePool(), o.LongBits = requireLongbits(), o.isNode = !!(typeof commonjsGlobal < "u" && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node), o.global = o.isNode && commonjsGlobal || typeof window < "u" && window || typeof self < "u" && self || minimal$1, o.emptyArray = Object.freeze ? Object.freeze([]) : (
878
1032
  /* istanbul ignore next */
879
1033
  []
@@ -881,68 +1035,68 @@ function requireMinimal$1() {
881
1035
  /* istanbul ignore next */
882
1036
  {}
883
1037
  ), o.isInteger = Number.isInteger || /* istanbul ignore next */
884
- function(n) {
885
- return typeof n == "number" && isFinite(n) && Math.floor(n) === n;
886
- }, o.isString = function(n) {
887
- return typeof n == "string" || n instanceof String;
888
- }, o.isObject = function(n) {
889
- return n && typeof n == "object";
1038
+ function(r) {
1039
+ return typeof r == "number" && isFinite(r) && Math.floor(r) === r;
1040
+ }, o.isString = function(r) {
1041
+ return typeof r == "string" || r instanceof String;
1042
+ }, o.isObject = function(r) {
1043
+ return r && typeof r == "object";
890
1044
  }, o.isset = /**
891
1045
  * Checks if a property on a message is considered to be present.
892
1046
  * @param {Object} obj Plain object or message instance
893
1047
  * @param {string} prop Property name
894
1048
  * @returns {boolean} `true` if considered to be present, otherwise `false`
895
1049
  */
896
- o.isSet = function(n, i) {
897
- var e = n[i];
898
- return e != null && n.hasOwnProperty(i) ? typeof e != "object" || (Array.isArray(e) ? e.length : Object.keys(e).length) > 0 : !1;
1050
+ o.isSet = function(r, i) {
1051
+ var t = r[i];
1052
+ return t != null && r.hasOwnProperty(i) ? typeof t != "object" || (Array.isArray(t) ? t.length : Object.keys(t).length) > 0 : !1;
899
1053
  }, o.Buffer = function() {
900
1054
  try {
901
- var r = o.inquire("buffer").Buffer;
902
- return r.prototype.utf8Write ? r : (
1055
+ var n = o.inquire("buffer").Buffer;
1056
+ return n.prototype.utf8Write ? n : (
903
1057
  /* istanbul ignore next */
904
1058
  null
905
1059
  );
906
1060
  } catch {
907
1061
  return null;
908
1062
  }
909
- }(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(n) {
910
- return typeof n == "number" ? o.Buffer ? o._Buffer_allocUnsafe(n) : new o.Array(n) : o.Buffer ? o._Buffer_from(n) : typeof Uint8Array > "u" ? n : new Uint8Array(n);
1063
+ }(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(r) {
1064
+ return typeof r == "number" ? o.Buffer ? o._Buffer_allocUnsafe(r) : new o.Array(r) : o.Buffer ? o._Buffer_from(r) : typeof Uint8Array > "u" ? r : new Uint8Array(r);
911
1065
  }, o.Array = typeof Uint8Array < "u" ? Uint8Array : Array, o.Long = /* istanbul ignore next */
912
1066
  o.global.dcodeIO && /* istanbul ignore next */
913
1067
  o.global.dcodeIO.Long || /* istanbul ignore next */
914
- o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(n) {
915
- return n ? o.LongBits.from(n).toHash() : o.LongBits.zeroHash;
916
- }, o.longFromHash = function(n, i) {
917
- var e = o.LongBits.fromHash(n);
918
- return o.Long ? o.Long.fromBits(e.lo, e.hi, i) : e.toNumber(!!i);
1068
+ o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(r) {
1069
+ return r ? o.LongBits.from(r).toHash() : o.LongBits.zeroHash;
1070
+ }, o.longFromHash = function(r, i) {
1071
+ var t = o.LongBits.fromHash(r);
1072
+ return o.Long ? o.Long.fromBits(t.lo, t.hi, i) : t.toNumber(!!i);
919
1073
  };
920
- function u(r, n, i) {
921
- for (var e = Object.keys(n), t = 0; t < e.length; ++t)
922
- (r[e[t]] === void 0 || !i) && (r[e[t]] = n[e[t]]);
923
- return r;
1074
+ function a(n, r, i) {
1075
+ for (var t = Object.keys(r), e = 0; e < t.length; ++e)
1076
+ (n[t[e]] === void 0 || !i) && (n[t[e]] = r[t[e]]);
1077
+ return n;
924
1078
  }
925
- o.merge = u, o.lcFirst = function(n) {
926
- return n.charAt(0).toLowerCase() + n.substring(1);
1079
+ o.merge = a, o.lcFirst = function(r) {
1080
+ return r.charAt(0).toLowerCase() + r.substring(1);
927
1081
  };
928
- function c(r) {
929
- function n(i, e) {
930
- if (!(this instanceof n))
931
- return new n(i, e);
1082
+ function u(n) {
1083
+ function r(i, t) {
1084
+ if (!(this instanceof r))
1085
+ return new r(i, t);
932
1086
  Object.defineProperty(this, "message", { get: function() {
933
1087
  return i;
934
- } }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), e && u(this, e);
1088
+ } }), Error.captureStackTrace ? Error.captureStackTrace(this, r) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), t && a(this, t);
935
1089
  }
936
- return n.prototype = Object.create(Error.prototype, {
1090
+ return r.prototype = Object.create(Error.prototype, {
937
1091
  constructor: {
938
- value: n,
1092
+ value: r,
939
1093
  writable: !0,
940
1094
  enumerable: !1,
941
1095
  configurable: !0
942
1096
  },
943
1097
  name: {
944
1098
  get: function() {
945
- return r;
1099
+ return n;
946
1100
  },
947
1101
  set: void 0,
948
1102
  enumerable: !1,
@@ -960,20 +1114,20 @@ function requireMinimal$1() {
960
1114
  enumerable: !1,
961
1115
  configurable: !0
962
1116
  }
963
- }), n;
1117
+ }), r;
964
1118
  }
965
- o.newError = c, o.ProtocolError = c("ProtocolError"), o.oneOfGetter = function(n) {
966
- for (var i = {}, e = 0; e < n.length; ++e)
967
- i[n[e]] = 1;
1119
+ o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(r) {
1120
+ for (var i = {}, t = 0; t < r.length; ++t)
1121
+ i[r[t]] = 1;
968
1122
  return function() {
969
- for (var t = Object.keys(this), s = t.length - 1; s > -1; --s)
970
- if (i[t[s]] === 1 && this[t[s]] !== void 0 && this[t[s]] !== null)
971
- return t[s];
1123
+ for (var e = Object.keys(this), s = e.length - 1; s > -1; --s)
1124
+ if (i[e[s]] === 1 && this[e[s]] !== void 0 && this[e[s]] !== null)
1125
+ return e[s];
972
1126
  };
973
- }, o.oneOfSetter = function(n) {
1127
+ }, o.oneOfSetter = function(r) {
974
1128
  return function(i) {
975
- for (var e = 0; e < n.length; ++e)
976
- n[e] !== i && delete this[n[e]];
1129
+ for (var t = 0; t < r.length; ++t)
1130
+ r[t] !== i && delete this[r[t]];
977
1131
  };
978
1132
  }, o.toJSONOptions = {
979
1133
  longs: String,
@@ -981,17 +1135,17 @@ function requireMinimal$1() {
981
1135
  bytes: String,
982
1136
  json: !0
983
1137
  }, o._configure = function() {
984
- var r = o.Buffer;
985
- if (!r) {
1138
+ var n = o.Buffer;
1139
+ if (!n) {
986
1140
  o._Buffer_from = o._Buffer_allocUnsafe = null;
987
1141
  return;
988
1142
  }
989
- o._Buffer_from = r.from !== Uint8Array.from && r.from || /* istanbul ignore next */
990
- function(i, e) {
991
- return new r(i, e);
992
- }, o._Buffer_allocUnsafe = r.allocUnsafe || /* istanbul ignore next */
1143
+ o._Buffer_from = n.from !== Uint8Array.from && n.from || /* istanbul ignore next */
1144
+ function(i, t) {
1145
+ return new n(i, t);
1146
+ }, o._Buffer_allocUnsafe = n.allocUnsafe || /* istanbul ignore next */
993
1147
  function(i) {
994
- return new r(i);
1148
+ return new n(i);
995
1149
  };
996
1150
  };
997
1151
  }(minimal$1)), minimal$1;
@@ -999,277 +1153,277 @@ function requireMinimal$1() {
999
1153
  var writer, hasRequiredWriter;
1000
1154
  function requireWriter() {
1001
1155
  if (hasRequiredWriter) return writer;
1002
- hasRequiredWriter = 1, writer = t;
1003
- var f = requireMinimal$1(), o, u = f.LongBits, c = f.base64, r = f.utf8;
1004
- function n(b, m, g) {
1005
- this.fn = b, this.len = m, this.next = void 0, this.val = g;
1156
+ hasRequiredWriter = 1, writer = e;
1157
+ var h = requireMinimal$1(), o, a = h.LongBits, u = h.base64, n = h.utf8;
1158
+ function r(b, g, k) {
1159
+ this.fn = b, this.len = g, this.next = void 0, this.val = k;
1006
1160
  }
1007
1161
  function i() {
1008
1162
  }
1009
- function e(b) {
1163
+ function t(b) {
1010
1164
  this.head = b.head, this.tail = b.tail, this.len = b.len, this.next = b.states;
1011
1165
  }
1012
- function t() {
1013
- this.len = 0, this.head = new n(i, 0, 0), this.tail = this.head, this.states = null;
1166
+ function e() {
1167
+ this.len = 0, this.head = new r(i, 0, 0), this.tail = this.head, this.states = null;
1014
1168
  }
1015
1169
  var s = function() {
1016
- return f.Buffer ? function() {
1017
- return (t.create = function() {
1170
+ return h.Buffer ? function() {
1171
+ return (e.create = function() {
1018
1172
  return new o();
1019
1173
  })();
1020
1174
  } : function() {
1021
- return new t();
1175
+ return new e();
1022
1176
  };
1023
1177
  };
1024
- t.create = s(), t.alloc = function(m) {
1025
- return new f.Array(m);
1026
- }, f.Array !== Array && (t.alloc = f.pool(t.alloc, f.Array.prototype.subarray)), t.prototype._push = function(m, g, k) {
1027
- return this.tail = this.tail.next = new n(m, g, k), this.len += g, this;
1178
+ e.create = s(), e.alloc = function(g) {
1179
+ return new h.Array(g);
1180
+ }, h.Array !== Array && (e.alloc = h.pool(e.alloc, h.Array.prototype.subarray)), e.prototype._push = function(g, k, _) {
1181
+ return this.tail = this.tail.next = new r(g, k, _), this.len += k, this;
1028
1182
  };
1029
- function l(b, m, g) {
1030
- m[g] = b & 255;
1183
+ function l(b, g, k) {
1184
+ g[k] = b & 255;
1031
1185
  }
1032
- function a(b, m, g) {
1186
+ function c(b, g, k) {
1033
1187
  for (; b > 127; )
1034
- m[g++] = b & 127 | 128, b >>>= 7;
1035
- m[g] = b;
1188
+ g[k++] = b & 127 | 128, b >>>= 7;
1189
+ g[k] = b;
1036
1190
  }
1037
- function d(b, m) {
1038
- this.len = b, this.next = void 0, this.val = m;
1191
+ function d(b, g) {
1192
+ this.len = b, this.next = void 0, this.val = g;
1039
1193
  }
1040
- d.prototype = Object.create(n.prototype), d.prototype.fn = a, t.prototype.uint32 = function(m) {
1194
+ d.prototype = Object.create(r.prototype), d.prototype.fn = c, e.prototype.uint32 = function(g) {
1041
1195
  return this.len += (this.tail = this.tail.next = new d(
1042
- (m = m >>> 0) < 128 ? 1 : m < 16384 ? 2 : m < 2097152 ? 3 : m < 268435456 ? 4 : 5,
1043
- m
1196
+ (g = g >>> 0) < 128 ? 1 : g < 16384 ? 2 : g < 2097152 ? 3 : g < 268435456 ? 4 : 5,
1197
+ g
1044
1198
  )).len, this;
1045
- }, t.prototype.int32 = function(m) {
1046
- return m < 0 ? this._push(y, 10, u.fromNumber(m)) : this.uint32(m);
1047
- }, t.prototype.sint32 = function(m) {
1048
- return this.uint32((m << 1 ^ m >> 31) >>> 0);
1199
+ }, e.prototype.int32 = function(g) {
1200
+ return g < 0 ? this._push(y, 10, a.fromNumber(g)) : this.uint32(g);
1201
+ }, e.prototype.sint32 = function(g) {
1202
+ return this.uint32((g << 1 ^ g >> 31) >>> 0);
1049
1203
  };
1050
- function y(b, m, g) {
1204
+ function y(b, g, k) {
1051
1205
  for (; b.hi; )
1052
- m[g++] = b.lo & 127 | 128, b.lo = (b.lo >>> 7 | b.hi << 25) >>> 0, b.hi >>>= 7;
1206
+ g[k++] = b.lo & 127 | 128, b.lo = (b.lo >>> 7 | b.hi << 25) >>> 0, b.hi >>>= 7;
1053
1207
  for (; b.lo > 127; )
1054
- m[g++] = b.lo & 127 | 128, b.lo = b.lo >>> 7;
1055
- m[g++] = b.lo;
1208
+ g[k++] = b.lo & 127 | 128, b.lo = b.lo >>> 7;
1209
+ g[k++] = b.lo;
1056
1210
  }
1057
- t.prototype.uint64 = function(m) {
1058
- var g = u.from(m);
1059
- return this._push(y, g.length(), g);
1060
- }, t.prototype.int64 = t.prototype.uint64, t.prototype.sint64 = function(m) {
1061
- var g = u.from(m).zzEncode();
1062
- return this._push(y, g.length(), g);
1063
- }, t.prototype.bool = function(m) {
1064
- return this._push(l, 1, m ? 1 : 0);
1211
+ e.prototype.uint64 = function(g) {
1212
+ var k = a.from(g);
1213
+ return this._push(y, k.length(), k);
1214
+ }, e.prototype.int64 = e.prototype.uint64, e.prototype.sint64 = function(g) {
1215
+ var k = a.from(g).zzEncode();
1216
+ return this._push(y, k.length(), k);
1217
+ }, e.prototype.bool = function(g) {
1218
+ return this._push(l, 1, g ? 1 : 0);
1065
1219
  };
1066
- function p(b, m, g) {
1067
- m[g] = b & 255, m[g + 1] = b >>> 8 & 255, m[g + 2] = b >>> 16 & 255, m[g + 3] = b >>> 24;
1220
+ function p(b, g, k) {
1221
+ g[k] = b & 255, g[k + 1] = b >>> 8 & 255, g[k + 2] = b >>> 16 & 255, g[k + 3] = b >>> 24;
1068
1222
  }
1069
- t.prototype.fixed32 = function(m) {
1070
- return this._push(p, 4, m >>> 0);
1071
- }, t.prototype.sfixed32 = t.prototype.fixed32, t.prototype.fixed64 = function(m) {
1072
- var g = u.from(m);
1073
- return this._push(p, 4, g.lo)._push(p, 4, g.hi);
1074
- }, t.prototype.sfixed64 = t.prototype.fixed64, t.prototype.float = function(m) {
1075
- return this._push(f.float.writeFloatLE, 4, m);
1076
- }, t.prototype.double = function(m) {
1077
- return this._push(f.float.writeDoubleLE, 8, m);
1223
+ e.prototype.fixed32 = function(g) {
1224
+ return this._push(p, 4, g >>> 0);
1225
+ }, e.prototype.sfixed32 = e.prototype.fixed32, e.prototype.fixed64 = function(g) {
1226
+ var k = a.from(g);
1227
+ return this._push(p, 4, k.lo)._push(p, 4, k.hi);
1228
+ }, e.prototype.sfixed64 = e.prototype.fixed64, e.prototype.float = function(g) {
1229
+ return this._push(h.float.writeFloatLE, 4, g);
1230
+ }, e.prototype.double = function(g) {
1231
+ return this._push(h.float.writeDoubleLE, 8, g);
1078
1232
  };
1079
- var w = f.Array.prototype.set ? function(m, g, k) {
1080
- g.set(m, k);
1081
- } : function(m, g, k) {
1082
- for (var I = 0; I < m.length; ++I)
1083
- g[k + I] = m[I];
1233
+ var w = h.Array.prototype.set ? function(g, k, _) {
1234
+ k.set(g, _);
1235
+ } : function(g, k, _) {
1236
+ for (var R = 0; R < g.length; ++R)
1237
+ k[_ + R] = g[R];
1084
1238
  };
1085
- return t.prototype.bytes = function(m) {
1086
- var g = m.length >>> 0;
1087
- if (!g)
1239
+ return e.prototype.bytes = function(g) {
1240
+ var k = g.length >>> 0;
1241
+ if (!k)
1088
1242
  return this._push(l, 1, 0);
1089
- if (f.isString(m)) {
1090
- var k = t.alloc(g = c.length(m));
1091
- c.decode(m, k, 0), m = k;
1243
+ if (h.isString(g)) {
1244
+ var _ = e.alloc(k = u.length(g));
1245
+ u.decode(g, _, 0), g = _;
1092
1246
  }
1093
- return this.uint32(g)._push(w, g, m);
1094
- }, t.prototype.string = function(m) {
1095
- var g = r.length(m);
1096
- return g ? this.uint32(g)._push(r.write, g, m) : this._push(l, 1, 0);
1097
- }, t.prototype.fork = function() {
1098
- return this.states = new e(this), this.head = this.tail = new n(i, 0, 0), this.len = 0, this;
1099
- }, t.prototype.reset = function() {
1100
- 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 n(i, 0, 0), this.len = 0), this;
1101
- }, t.prototype.ldelim = function() {
1102
- var m = this.head, g = this.tail, k = this.len;
1103
- return this.reset().uint32(k), k && (this.tail.next = m.next, this.tail = g, this.len += k), this;
1104
- }, t.prototype.finish = function() {
1105
- for (var m = this.head.next, g = this.constructor.alloc(this.len), k = 0; m; )
1106
- m.fn(m.val, g, k), k += m.len, m = m.next;
1107
- return g;
1108
- }, t._configure = function(b) {
1109
- o = b, t.create = s(), o._configure();
1247
+ return this.uint32(k)._push(w, k, g);
1248
+ }, e.prototype.string = function(g) {
1249
+ var k = n.length(g);
1250
+ return k ? this.uint32(k)._push(n.write, k, g) : this._push(l, 1, 0);
1251
+ }, e.prototype.fork = function() {
1252
+ return this.states = new t(this), this.head = this.tail = new r(i, 0, 0), this.len = 0, this;
1253
+ }, e.prototype.reset = function() {
1254
+ 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 r(i, 0, 0), this.len = 0), this;
1255
+ }, e.prototype.ldelim = function() {
1256
+ var g = this.head, k = this.tail, _ = this.len;
1257
+ return this.reset().uint32(_), _ && (this.tail.next = g.next, this.tail = k, this.len += _), this;
1258
+ }, e.prototype.finish = function() {
1259
+ for (var g = this.head.next, k = this.constructor.alloc(this.len), _ = 0; g; )
1260
+ g.fn(g.val, k, _), _ += g.len, g = g.next;
1261
+ return k;
1262
+ }, e._configure = function(b) {
1263
+ o = b, e.create = s(), o._configure();
1110
1264
  }, writer;
1111
1265
  }
1112
1266
  var writer_buffer, hasRequiredWriter_buffer;
1113
1267
  function requireWriter_buffer() {
1114
1268
  if (hasRequiredWriter_buffer) return writer_buffer;
1115
- hasRequiredWriter_buffer = 1, writer_buffer = u;
1116
- var f = requireWriter();
1117
- (u.prototype = Object.create(f.prototype)).constructor = u;
1269
+ hasRequiredWriter_buffer = 1, writer_buffer = a;
1270
+ var h = requireWriter();
1271
+ (a.prototype = Object.create(h.prototype)).constructor = a;
1118
1272
  var o = requireMinimal$1();
1119
- function u() {
1120
- f.call(this);
1273
+ function a() {
1274
+ h.call(this);
1121
1275
  }
1122
- u._configure = function() {
1123
- u.alloc = o._Buffer_allocUnsafe, u.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(n, i, e) {
1124
- i.set(n, e);
1125
- } : function(n, i, e) {
1126
- if (n.copy)
1127
- n.copy(i, e, 0, n.length);
1128
- else for (var t = 0; t < n.length; )
1129
- i[e++] = n[t++];
1276
+ a._configure = function() {
1277
+ a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(r, i, t) {
1278
+ i.set(r, t);
1279
+ } : function(r, i, t) {
1280
+ if (r.copy)
1281
+ r.copy(i, t, 0, r.length);
1282
+ else for (var e = 0; e < r.length; )
1283
+ i[t++] = r[e++];
1130
1284
  };
1131
- }, u.prototype.bytes = function(n) {
1132
- o.isString(n) && (n = o._Buffer_from(n, "base64"));
1133
- var i = n.length >>> 0;
1134
- return this.uint32(i), i && this._push(u.writeBytesBuffer, i, n), this;
1285
+ }, a.prototype.bytes = function(r) {
1286
+ o.isString(r) && (r = o._Buffer_from(r, "base64"));
1287
+ var i = r.length >>> 0;
1288
+ return this.uint32(i), i && this._push(a.writeBytesBuffer, i, r), this;
1135
1289
  };
1136
- function c(r, n, i) {
1137
- r.length < 40 ? o.utf8.write(r, n, i) : n.utf8Write ? n.utf8Write(r, i) : n.write(r, i);
1290
+ function u(n, r, i) {
1291
+ n.length < 40 ? o.utf8.write(n, r, i) : r.utf8Write ? r.utf8Write(n, i) : r.write(n, i);
1138
1292
  }
1139
- return u.prototype.string = function(n) {
1140
- var i = o.Buffer.byteLength(n);
1141
- return this.uint32(i), i && this._push(c, i, n), this;
1142
- }, u._configure(), writer_buffer;
1293
+ return a.prototype.string = function(r) {
1294
+ var i = o.Buffer.byteLength(r);
1295
+ return this.uint32(i), i && this._push(u, i, r), this;
1296
+ }, a._configure(), writer_buffer;
1143
1297
  }
1144
1298
  var reader, hasRequiredReader;
1145
1299
  function requireReader() {
1146
1300
  if (hasRequiredReader) return reader;
1147
- hasRequiredReader = 1, reader = n;
1148
- var f = requireMinimal$1(), o, u = f.LongBits, c = f.utf8;
1149
- function r(a, d) {
1150
- return RangeError("index out of range: " + a.pos + " + " + (d || 1) + " > " + a.len);
1301
+ hasRequiredReader = 1, reader = r;
1302
+ var h = requireMinimal$1(), o, a = h.LongBits, u = h.utf8;
1303
+ function n(c, d) {
1304
+ return RangeError("index out of range: " + c.pos + " + " + (d || 1) + " > " + c.len);
1151
1305
  }
1152
- function n(a) {
1153
- this.buf = a, this.pos = 0, this.len = a.length;
1306
+ function r(c) {
1307
+ this.buf = c, this.pos = 0, this.len = c.length;
1154
1308
  }
1155
1309
  var i = typeof Uint8Array < "u" ? function(d) {
1156
1310
  if (d instanceof Uint8Array || Array.isArray(d))
1157
- return new n(d);
1311
+ return new r(d);
1158
1312
  throw Error("illegal buffer");
1159
1313
  } : function(d) {
1160
1314
  if (Array.isArray(d))
1161
- return new n(d);
1315
+ return new r(d);
1162
1316
  throw Error("illegal buffer");
1163
- }, e = function() {
1164
- return f.Buffer ? function(y) {
1165
- return (n.create = function(w) {
1166
- return f.Buffer.isBuffer(w) ? new o(w) : i(w);
1317
+ }, t = function() {
1318
+ return h.Buffer ? function(y) {
1319
+ return (r.create = function(w) {
1320
+ return h.Buffer.isBuffer(w) ? new o(w) : i(w);
1167
1321
  })(y);
1168
1322
  } : i;
1169
1323
  };
1170
- n.create = e(), n.prototype._slice = f.Array.prototype.subarray || /* istanbul ignore next */
1171
- f.Array.prototype.slice, n.prototype.uint32 = /* @__PURE__ */ function() {
1324
+ r.create = t(), r.prototype._slice = h.Array.prototype.subarray || /* istanbul ignore next */
1325
+ h.Array.prototype.slice, r.prototype.uint32 = /* @__PURE__ */ function() {
1172
1326
  var d = 4294967295;
1173
1327
  return function() {
1174
1328
  if (d = (this.buf[this.pos] & 127) >>> 0, this.buf[this.pos++] < 128 || (d = (d | (this.buf[this.pos] & 127) << 7) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 14) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 21) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 15) << 28) >>> 0, this.buf[this.pos++] < 128)) return d;
1175
1329
  if ((this.pos += 5) > this.len)
1176
- throw this.pos = this.len, r(this, 10);
1330
+ throw this.pos = this.len, n(this, 10);
1177
1331
  return d;
1178
1332
  };
1179
- }(), n.prototype.int32 = function() {
1333
+ }(), r.prototype.int32 = function() {
1180
1334
  return this.uint32() | 0;
1181
- }, n.prototype.sint32 = function() {
1335
+ }, r.prototype.sint32 = function() {
1182
1336
  var d = this.uint32();
1183
1337
  return d >>> 1 ^ -(d & 1) | 0;
1184
1338
  };
1185
- function t() {
1186
- var a = new u(0, 0), d = 0;
1339
+ function e() {
1340
+ var c = new a(0, 0), d = 0;
1187
1341
  if (this.len - this.pos > 4) {
1188
1342
  for (; d < 4; ++d)
1189
- if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1190
- return a;
1191
- if (a.lo = (a.lo | (this.buf[this.pos] & 127) << 28) >>> 0, a.hi = (a.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
1192
- return a;
1343
+ if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1344
+ return c;
1345
+ if (c.lo = (c.lo | (this.buf[this.pos] & 127) << 28) >>> 0, c.hi = (c.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
1346
+ return c;
1193
1347
  d = 0;
1194
1348
  } else {
1195
1349
  for (; d < 3; ++d) {
1196
1350
  if (this.pos >= this.len)
1197
- throw r(this);
1198
- if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1199
- return a;
1351
+ throw n(this);
1352
+ if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1353
+ return c;
1200
1354
  }
1201
- return a.lo = (a.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, a;
1355
+ return c.lo = (c.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, c;
1202
1356
  }
1203
1357
  if (this.len - this.pos > 4) {
1204
1358
  for (; d < 5; ++d)
1205
- if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1206
- return a;
1359
+ if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1360
+ return c;
1207
1361
  } else
1208
1362
  for (; d < 5; ++d) {
1209
1363
  if (this.pos >= this.len)
1210
- throw r(this);
1211
- if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1212
- return a;
1364
+ throw n(this);
1365
+ if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1366
+ return c;
1213
1367
  }
1214
1368
  throw Error("invalid varint encoding");
1215
1369
  }
1216
- n.prototype.bool = function() {
1370
+ r.prototype.bool = function() {
1217
1371
  return this.uint32() !== 0;
1218
1372
  };
1219
- function s(a, d) {
1220
- return (a[d - 4] | a[d - 3] << 8 | a[d - 2] << 16 | a[d - 1] << 24) >>> 0;
1373
+ function s(c, d) {
1374
+ return (c[d - 4] | c[d - 3] << 8 | c[d - 2] << 16 | c[d - 1] << 24) >>> 0;
1221
1375
  }
1222
- n.prototype.fixed32 = function() {
1376
+ r.prototype.fixed32 = function() {
1223
1377
  if (this.pos + 4 > this.len)
1224
- throw r(this, 4);
1378
+ throw n(this, 4);
1225
1379
  return s(this.buf, this.pos += 4);
1226
- }, n.prototype.sfixed32 = function() {
1380
+ }, r.prototype.sfixed32 = function() {
1227
1381
  if (this.pos + 4 > this.len)
1228
- throw r(this, 4);
1382
+ throw n(this, 4);
1229
1383
  return s(this.buf, this.pos += 4) | 0;
1230
1384
  };
1231
1385
  function l() {
1232
1386
  if (this.pos + 8 > this.len)
1233
- throw r(this, 8);
1234
- return new u(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
1387
+ throw n(this, 8);
1388
+ return new a(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
1235
1389
  }
1236
- return n.prototype.float = function() {
1390
+ return r.prototype.float = function() {
1237
1391
  if (this.pos + 4 > this.len)
1238
- throw r(this, 4);
1239
- var d = f.float.readFloatLE(this.buf, this.pos);
1392
+ throw n(this, 4);
1393
+ var d = h.float.readFloatLE(this.buf, this.pos);
1240
1394
  return this.pos += 4, d;
1241
- }, n.prototype.double = function() {
1395
+ }, r.prototype.double = function() {
1242
1396
  if (this.pos + 8 > this.len)
1243
- throw r(this, 4);
1244
- var d = f.float.readDoubleLE(this.buf, this.pos);
1397
+ throw n(this, 4);
1398
+ var d = h.float.readDoubleLE(this.buf, this.pos);
1245
1399
  return this.pos += 8, d;
1246
- }, n.prototype.bytes = function() {
1400
+ }, r.prototype.bytes = function() {
1247
1401
  var d = this.uint32(), y = this.pos, p = this.pos + d;
1248
1402
  if (p > this.len)
1249
- throw r(this, d);
1403
+ throw n(this, d);
1250
1404
  if (this.pos += d, Array.isArray(this.buf))
1251
1405
  return this.buf.slice(y, p);
1252
1406
  if (y === p) {
1253
- var w = f.Buffer;
1407
+ var w = h.Buffer;
1254
1408
  return w ? w.alloc(0) : new this.buf.constructor(0);
1255
1409
  }
1256
1410
  return this._slice.call(this.buf, y, p);
1257
- }, n.prototype.string = function() {
1411
+ }, r.prototype.string = function() {
1258
1412
  var d = this.bytes();
1259
- return c.read(d, 0, d.length);
1260
- }, n.prototype.skip = function(d) {
1413
+ return u.read(d, 0, d.length);
1414
+ }, r.prototype.skip = function(d) {
1261
1415
  if (typeof d == "number") {
1262
1416
  if (this.pos + d > this.len)
1263
- throw r(this, d);
1417
+ throw n(this, d);
1264
1418
  this.pos += d;
1265
1419
  } else
1266
1420
  do
1267
1421
  if (this.pos >= this.len)
1268
- throw r(this);
1422
+ throw n(this);
1269
1423
  while (this.buf[this.pos++] & 128);
1270
1424
  return this;
1271
- }, n.prototype.skipType = function(a) {
1272
- switch (a) {
1425
+ }, r.prototype.skipType = function(c) {
1426
+ switch (c) {
1273
1427
  case 0:
1274
1428
  this.skip();
1275
1429
  break;
@@ -1280,32 +1434,32 @@ function requireReader() {
1280
1434
  this.skip(this.uint32());
1281
1435
  break;
1282
1436
  case 3:
1283
- for (; (a = this.uint32() & 7) !== 4; )
1284
- this.skipType(a);
1437
+ for (; (c = this.uint32() & 7) !== 4; )
1438
+ this.skipType(c);
1285
1439
  break;
1286
1440
  case 5:
1287
1441
  this.skip(4);
1288
1442
  break;
1289
1443
  /* istanbul ignore next */
1290
1444
  default:
1291
- throw Error("invalid wire type " + a + " at offset " + this.pos);
1445
+ throw Error("invalid wire type " + c + " at offset " + this.pos);
1292
1446
  }
1293
1447
  return this;
1294
- }, n._configure = function(a) {
1295
- o = a, n.create = e(), o._configure();
1296
- var d = f.Long ? "toLong" : (
1448
+ }, r._configure = function(c) {
1449
+ o = c, r.create = t(), o._configure();
1450
+ var d = h.Long ? "toLong" : (
1297
1451
  /* istanbul ignore next */
1298
1452
  "toNumber"
1299
1453
  );
1300
- f.merge(n.prototype, {
1454
+ h.merge(r.prototype, {
1301
1455
  int64: function() {
1302
- return t.call(this)[d](!1);
1456
+ return e.call(this)[d](!1);
1303
1457
  },
1304
1458
  uint64: function() {
1305
- return t.call(this)[d](!0);
1459
+ return e.call(this)[d](!0);
1306
1460
  },
1307
1461
  sint64: function() {
1308
- return t.call(this).zzDecode()[d](!1);
1462
+ return e.call(this).zzDecode()[d](!1);
1309
1463
  },
1310
1464
  fixed64: function() {
1311
1465
  return l.call(this)[d](!0);
@@ -1319,80 +1473,80 @@ function requireReader() {
1319
1473
  var reader_buffer, hasRequiredReader_buffer;
1320
1474
  function requireReader_buffer() {
1321
1475
  if (hasRequiredReader_buffer) return reader_buffer;
1322
- hasRequiredReader_buffer = 1, reader_buffer = u;
1323
- var f = requireReader();
1324
- (u.prototype = Object.create(f.prototype)).constructor = u;
1476
+ hasRequiredReader_buffer = 1, reader_buffer = a;
1477
+ var h = requireReader();
1478
+ (a.prototype = Object.create(h.prototype)).constructor = a;
1325
1479
  var o = requireMinimal$1();
1326
- function u(c) {
1327
- f.call(this, c);
1480
+ function a(u) {
1481
+ h.call(this, u);
1328
1482
  }
1329
- return u._configure = function() {
1330
- o.Buffer && (u.prototype._slice = o.Buffer.prototype.slice);
1331
- }, u.prototype.string = function() {
1332
- var r = this.uint32();
1333
- return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + r, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + r, this.len));
1334
- }, u._configure(), reader_buffer;
1483
+ return a._configure = function() {
1484
+ o.Buffer && (a.prototype._slice = o.Buffer.prototype.slice);
1485
+ }, a.prototype.string = function() {
1486
+ var n = this.uint32();
1487
+ return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + n, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + n, this.len));
1488
+ }, a._configure(), reader_buffer;
1335
1489
  }
1336
1490
  var rpc = {}, service, hasRequiredService;
1337
1491
  function requireService() {
1338
1492
  if (hasRequiredService) return service;
1339
1493
  hasRequiredService = 1, service = o;
1340
- var f = requireMinimal$1();
1341
- (o.prototype = Object.create(f.EventEmitter.prototype)).constructor = o;
1342
- function o(u, c, r) {
1343
- if (typeof u != "function")
1494
+ var h = requireMinimal$1();
1495
+ (o.prototype = Object.create(h.EventEmitter.prototype)).constructor = o;
1496
+ function o(a, u, n) {
1497
+ if (typeof a != "function")
1344
1498
  throw TypeError("rpcImpl must be a function");
1345
- f.EventEmitter.call(this), this.rpcImpl = u, this.requestDelimited = !!c, this.responseDelimited = !!r;
1499
+ h.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!n;
1346
1500
  }
1347
- return o.prototype.rpcCall = function u(c, r, n, i, e) {
1501
+ return o.prototype.rpcCall = function a(u, n, r, i, t) {
1348
1502
  if (!i)
1349
1503
  throw TypeError("request must be specified");
1350
- var t = this;
1351
- if (!e)
1352
- return f.asPromise(u, t, c, r, n, i);
1353
- if (!t.rpcImpl) {
1504
+ var e = this;
1505
+ if (!t)
1506
+ return h.asPromise(a, e, u, n, r, i);
1507
+ if (!e.rpcImpl) {
1354
1508
  setTimeout(function() {
1355
- e(Error("already ended"));
1509
+ t(Error("already ended"));
1356
1510
  }, 0);
1357
1511
  return;
1358
1512
  }
1359
1513
  try {
1360
- return t.rpcImpl(
1361
- c,
1362
- r[t.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
1363
- function(l, a) {
1514
+ return e.rpcImpl(
1515
+ u,
1516
+ n[e.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
1517
+ function(l, c) {
1364
1518
  if (l)
1365
- return t.emit("error", l, c), e(l);
1366
- if (a === null) {
1367
- t.end(
1519
+ return e.emit("error", l, u), t(l);
1520
+ if (c === null) {
1521
+ e.end(
1368
1522
  /* endedByRPC */
1369
1523
  !0
1370
1524
  );
1371
1525
  return;
1372
1526
  }
1373
- if (!(a instanceof n))
1527
+ if (!(c instanceof r))
1374
1528
  try {
1375
- a = n[t.responseDelimited ? "decodeDelimited" : "decode"](a);
1529
+ c = r[e.responseDelimited ? "decodeDelimited" : "decode"](c);
1376
1530
  } catch (d) {
1377
- return t.emit("error", d, c), e(d);
1531
+ return e.emit("error", d, u), t(d);
1378
1532
  }
1379
- return t.emit("data", a, c), e(null, a);
1533
+ return e.emit("data", c, u), t(null, c);
1380
1534
  }
1381
1535
  );
1382
1536
  } catch (s) {
1383
- t.emit("error", s, c), setTimeout(function() {
1384
- e(s);
1537
+ e.emit("error", s, u), setTimeout(function() {
1538
+ t(s);
1385
1539
  }, 0);
1386
1540
  return;
1387
1541
  }
1388
- }, o.prototype.end = function(c) {
1389
- return this.rpcImpl && (c || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
1542
+ }, o.prototype.end = function(u) {
1543
+ return this.rpcImpl && (u || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
1390
1544
  }, service;
1391
1545
  }
1392
1546
  var hasRequiredRpc;
1393
1547
  function requireRpc() {
1394
- return hasRequiredRpc || (hasRequiredRpc = 1, function(f) {
1395
- var o = f;
1548
+ return hasRequiredRpc || (hasRequiredRpc = 1, function(h) {
1549
+ var o = h;
1396
1550
  o.Service = requireService();
1397
1551
  }(rpc)), rpc;
1398
1552
  }
@@ -1402,13 +1556,13 @@ function requireRoots() {
1402
1556
  }
1403
1557
  var hasRequiredIndexMinimal;
1404
1558
  function requireIndexMinimal() {
1405
- return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(f) {
1406
- var o = f;
1407
- o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure = u;
1408
- function u() {
1559
+ return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(h) {
1560
+ var o = h;
1561
+ o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure = a;
1562
+ function a() {
1409
1563
  o.util._configure(), o.Writer._configure(o.BufferWriter), o.Reader._configure(o.BufferReader);
1410
1564
  }
1411
- u();
1565
+ a();
1412
1566
  }(indexMinimal)), indexMinimal;
1413
1567
  }
1414
1568
  var minimal, hasRequiredMinimal;
@@ -1417,42 +1571,42 @@ function requireMinimal() {
1417
1571
  }
1418
1572
  var minimalExports = requireMinimal();
1419
1573
  const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util = minimalExports.util, $root = minimalExports.roots.default || (minimalExports.roots.default = {}), com = $root.com = (() => {
1420
- const f = {};
1421
- return f.quick = function() {
1574
+ const h = {};
1575
+ return h.quick = function() {
1422
1576
  const o = {};
1423
1577
  return o.voice = function() {
1424
- const u = {};
1425
- return u.proto = function() {
1426
- const c = {};
1427
- return c.SeiData = function() {
1428
- function r(n) {
1429
- if (n) for (let i = Object.keys(n), e = 0; e < i.length; ++e) n[i[e]] != null && (this[i[e]] = n[i[e]]);
1578
+ const a = {};
1579
+ return a.proto = function() {
1580
+ const u = {};
1581
+ return u.SeiData = function() {
1582
+ function n(r) {
1583
+ if (r) for (let i = Object.keys(r), t = 0; t < i.length; ++t) r[i[t]] != null && (this[i[t]] = r[i[t]]);
1430
1584
  }
1431
- return r.prototype.event = 0, r.prototype.data = $util.newBuffer([]), r.prototype.compress = !1, r.prototype.version = 0, r.create = function(i) {
1432
- return new r(i);
1433
- }, r.encode = function(i, e) {
1434
- return e || (e = $Writer.create()), i.event != null && Object.hasOwnProperty.call(i, "event") && e.uint32(
1585
+ return n.prototype.event = 0, n.prototype.data = $util.newBuffer([]), n.prototype.compress = !1, n.prototype.version = 0, n.create = function(i) {
1586
+ return new n(i);
1587
+ }, n.encode = function(i, t) {
1588
+ return t || (t = $Writer.create()), i.event != null && Object.hasOwnProperty.call(i, "event") && t.uint32(
1435
1589
  /* id 1, wireType 0 =*/
1436
1590
  8
1437
- ).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") && e.uint32(
1591
+ ).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") && t.uint32(
1438
1592
  /* id 2, wireType 2 =*/
1439
1593
  18
1440
- ).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") && e.uint32(
1594
+ ).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") && t.uint32(
1441
1595
  /* id 3, wireType 0 =*/
1442
1596
  24
1443
- ).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") && e.uint32(
1597
+ ).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") && t.uint32(
1444
1598
  /* id 4, wireType 0 =*/
1445
1599
  32
1446
- ).int32(i.version), e;
1447
- }, r.encodeDelimited = function(i, e) {
1448
- return this.encode(i, e).ldelim();
1449
- }, r.decode = function(i, e, t) {
1600
+ ).int32(i.version), t;
1601
+ }, n.encodeDelimited = function(i, t) {
1602
+ return this.encode(i, t).ldelim();
1603
+ }, n.decode = function(i, t, e) {
1450
1604
  i instanceof $Reader || (i = $Reader.create(i));
1451
- let s = e === void 0 ? i.len : i.pos + e, l = new $root.com.quick.voice.proto.SeiData();
1605
+ let s = t === void 0 ? i.len : i.pos + t, l = new $root.com.quick.voice.proto.SeiData();
1452
1606
  for (; i.pos < s; ) {
1453
- let a = i.uint32();
1454
- if (a === t) break;
1455
- switch (a >>> 3) {
1607
+ let c = i.uint32();
1608
+ if (c === e) break;
1609
+ switch (c >>> 3) {
1456
1610
  case 1: {
1457
1611
  l.event = i.int32();
1458
1612
  break;
@@ -1470,14 +1624,14 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1470
1624
  break;
1471
1625
  }
1472
1626
  default:
1473
- i.skipType(a & 7);
1627
+ i.skipType(c & 7);
1474
1628
  break;
1475
1629
  }
1476
1630
  }
1477
1631
  return l;
1478
- }, r.decodeDelimited = function(i) {
1632
+ }, n.decodeDelimited = function(i) {
1479
1633
  return i instanceof $Reader || (i = new $Reader(i)), this.decode(i, i.uint32());
1480
- }, r.verify = function(i) {
1634
+ }, n.verify = function(i) {
1481
1635
  if (typeof i != "object" || i === null) return "object expected";
1482
1636
  if (i.event != null && i.hasOwnProperty("event"))
1483
1637
  switch (i.event) {
@@ -1488,126 +1642,126 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1488
1642
  break;
1489
1643
  }
1490
1644
  return i.data != null && i.hasOwnProperty("data") && !(i.data && typeof i.data.length == "number" || $util.isString(i.data)) ? "data: buffer expected" : i.compress != null && i.hasOwnProperty("compress") && typeof i.compress != "boolean" ? "compress: boolean expected" : i.version != null && i.hasOwnProperty("version") && !$util.isInteger(i.version) ? "version: integer expected" : null;
1491
- }, r.fromObject = function(i) {
1645
+ }, n.fromObject = function(i) {
1492
1646
  if (i instanceof $root.com.quick.voice.proto.SeiData) return i;
1493
- let e = new $root.com.quick.voice.proto.SeiData();
1647
+ let t = new $root.com.quick.voice.proto.SeiData();
1494
1648
  switch (i.event) {
1495
1649
  default:
1496
1650
  if (typeof i.event == "number") {
1497
- e.event = i.event;
1651
+ t.event = i.event;
1498
1652
  break;
1499
1653
  }
1500
1654
  break;
1501
1655
  case "Layout":
1502
1656
  case 0:
1503
- e.event = 0;
1657
+ t.event = 0;
1504
1658
  break;
1505
1659
  case "Custom":
1506
1660
  case 1:
1507
- e.event = 1;
1661
+ t.event = 1;
1508
1662
  break;
1509
1663
  }
1510
- return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data, e.data = $util.newBuffer($util.base64.length(i.data)), 0) : i.data.length >= 0 && (e.data = i.data)), i.compress != null && (e.compress = !!i.compress), i.version != null && (e.version = i.version | 0), e;
1511
- }, r.toObject = function(i, e) {
1512
- e || (e = {});
1513
- let t = {};
1514
- return e.defaults && (t.event = e.enums === String ? "Layout" : 0, e.bytes === String ? t.data = "" : (t.data = [], e.bytes !== Array && (t.data = $util.newBuffer(t.data))), t.compress = !1, t.version = 0), i.event != null && i.hasOwnProperty("event") && (t.event = e.enums === String ? $root.com.quick.voice.proto.EventType[i.event] === void 0 ? i.event : $root.com.quick.voice.proto.EventType[i.event] : i.event), i.data != null && i.hasOwnProperty("data") && (t.data = e.bytes === String ? $util.base64.encode(i.data, 0, i.data.length) : e.bytes === Array ? Array.prototype.slice.call(i.data) : i.data), i.compress != null && i.hasOwnProperty("compress") && (t.compress = i.compress), i.version != null && i.hasOwnProperty("version") && (t.version = i.version), t;
1515
- }, r.prototype.toJSON = function() {
1664
+ return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data, t.data = $util.newBuffer($util.base64.length(i.data)), 0) : i.data.length >= 0 && (t.data = i.data)), i.compress != null && (t.compress = !!i.compress), i.version != null && (t.version = i.version | 0), t;
1665
+ }, n.toObject = function(i, t) {
1666
+ t || (t = {});
1667
+ let e = {};
1668
+ return t.defaults && (e.event = t.enums === String ? "Layout" : 0, t.bytes === String ? e.data = "" : (e.data = [], t.bytes !== Array && (e.data = $util.newBuffer(e.data))), e.compress = !1, e.version = 0), i.event != null && i.hasOwnProperty("event") && (e.event = t.enums === String ? $root.com.quick.voice.proto.EventType[i.event] === void 0 ? i.event : $root.com.quick.voice.proto.EventType[i.event] : i.event), i.data != null && i.hasOwnProperty("data") && (e.data = t.bytes === String ? $util.base64.encode(i.data, 0, i.data.length) : t.bytes === Array ? Array.prototype.slice.call(i.data) : i.data), i.compress != null && i.hasOwnProperty("compress") && (e.compress = i.compress), i.version != null && i.hasOwnProperty("version") && (e.version = i.version), e;
1669
+ }, n.prototype.toJSON = function() {
1516
1670
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
1517
- }, r.getTypeUrl = function(i) {
1671
+ }, n.getTypeUrl = function(i) {
1518
1672
  return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
1519
- }, r;
1520
- }(), c.EventType = function() {
1521
- const r = {}, n = Object.create(r);
1522
- return n[r[0] = "Layout"] = 0, n[r[1] = "Custom"] = 1, n;
1523
- }(), c.LayoutData = function() {
1524
- function r(i) {
1525
- if (this.userMap = {}, i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
1673
+ }, n;
1674
+ }(), u.EventType = function() {
1675
+ const n = {}, r = Object.create(n);
1676
+ return r[n[0] = "Layout"] = 0, r[n[1] = "Custom"] = 1, r;
1677
+ }(), u.LayoutData = function() {
1678
+ function n(i) {
1679
+ if (this.userMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
1526
1680
  }
1527
- r.prototype.roomId = "", r.prototype.type = 0, r.prototype.userMap = $util.emptyObject, r.prototype.globalCustom = null;
1528
- let n;
1529
- return Object.defineProperty(r.prototype, "_globalCustom", {
1530
- get: $util.oneOfGetter(n = ["globalCustom"]),
1531
- set: $util.oneOfSetter(n)
1532
- }), r.create = function(e) {
1533
- return new r(e);
1534
- }, r.encode = function(e, t) {
1535
- if (t || (t = $Writer.create()), e.roomId != null && Object.hasOwnProperty.call(e, "roomId") && t.uint32(
1681
+ n.prototype.roomId = "", n.prototype.type = 0, n.prototype.userMap = $util.emptyObject, n.prototype.globalCustom = null;
1682
+ let r;
1683
+ return Object.defineProperty(n.prototype, "_globalCustom", {
1684
+ get: $util.oneOfGetter(r = ["globalCustom"]),
1685
+ set: $util.oneOfSetter(r)
1686
+ }), n.create = function(t) {
1687
+ return new n(t);
1688
+ }, n.encode = function(t, e) {
1689
+ if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
1536
1690
  /* id 1, wireType 2 =*/
1537
1691
  10
1538
- ).string(e.roomId), e.type != null && Object.hasOwnProperty.call(e, "type") && t.uint32(
1692
+ ).string(t.roomId), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
1539
1693
  /* id 2, wireType 0 =*/
1540
1694
  16
1541
- ).int32(e.type), e.userMap != null && Object.hasOwnProperty.call(e, "userMap"))
1542
- for (let s = Object.keys(e.userMap), l = 0; l < s.length; ++l)
1543
- t.uint32(
1695
+ ).int32(t.type), t.userMap != null && Object.hasOwnProperty.call(t, "userMap"))
1696
+ for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l)
1697
+ e.uint32(
1544
1698
  /* id 3, wireType 2 =*/
1545
1699
  26
1546
1700
  ).fork().uint32(
1547
1701
  /* id 1, wireType 2 =*/
1548
1702
  10
1549
- ).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(e.userMap[s[l]], t.uint32(
1703
+ ).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(t.userMap[s[l]], e.uint32(
1550
1704
  /* id 2, wireType 2 =*/
1551
1705
  18
1552
1706
  ).fork()).ldelim().ldelim();
1553
- return e.globalCustom != null && Object.hasOwnProperty.call(e, "globalCustom") && $root.com.quick.voice.proto.CustomInfo.encode(e.globalCustom, t.uint32(
1707
+ return t.globalCustom != null && Object.hasOwnProperty.call(t, "globalCustom") && $root.com.quick.voice.proto.CustomInfo.encode(t.globalCustom, e.uint32(
1554
1708
  /* id 4, wireType 2 =*/
1555
1709
  34
1556
- ).fork()).ldelim(), t;
1557
- }, r.encodeDelimited = function(e, t) {
1558
- return this.encode(e, t).ldelim();
1559
- }, r.decode = function(e, t, s) {
1560
- e instanceof $Reader || (e = $Reader.create(e));
1561
- let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.LayoutData(), d, y;
1562
- for (; e.pos < l; ) {
1563
- let p = e.uint32();
1710
+ ).fork()).ldelim(), e;
1711
+ }, n.encodeDelimited = function(t, e) {
1712
+ return this.encode(t, e).ldelim();
1713
+ }, n.decode = function(t, e, s) {
1714
+ t instanceof $Reader || (t = $Reader.create(t));
1715
+ let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.LayoutData(), d, y;
1716
+ for (; t.pos < l; ) {
1717
+ let p = t.uint32();
1564
1718
  if (p === s) break;
1565
1719
  switch (p >>> 3) {
1566
1720
  case 1: {
1567
- a.roomId = e.string();
1721
+ c.roomId = t.string();
1568
1722
  break;
1569
1723
  }
1570
1724
  case 2: {
1571
- a.type = e.int32();
1725
+ c.type = t.int32();
1572
1726
  break;
1573
1727
  }
1574
1728
  case 3: {
1575
- a.userMap === $util.emptyObject && (a.userMap = {});
1576
- let w = e.uint32() + e.pos;
1577
- for (d = "", y = null; e.pos < w; ) {
1578
- let b = e.uint32();
1729
+ c.userMap === $util.emptyObject && (c.userMap = {});
1730
+ let w = t.uint32() + t.pos;
1731
+ for (d = "", y = null; t.pos < w; ) {
1732
+ let b = t.uint32();
1579
1733
  switch (b >>> 3) {
1580
1734
  case 1:
1581
- d = e.string();
1735
+ d = t.string();
1582
1736
  break;
1583
1737
  case 2:
1584
- y = $root.com.quick.voice.proto.UserInfo.decode(e, e.uint32());
1738
+ y = $root.com.quick.voice.proto.UserInfo.decode(t, t.uint32());
1585
1739
  break;
1586
1740
  default:
1587
- e.skipType(b & 7);
1741
+ t.skipType(b & 7);
1588
1742
  break;
1589
1743
  }
1590
1744
  }
1591
- a.userMap[d] = y;
1745
+ c.userMap[d] = y;
1592
1746
  break;
1593
1747
  }
1594
1748
  case 4: {
1595
- a.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1749
+ c.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
1596
1750
  break;
1597
1751
  }
1598
1752
  default:
1599
- e.skipType(p & 7);
1753
+ t.skipType(p & 7);
1600
1754
  break;
1601
1755
  }
1602
1756
  }
1603
- return a;
1604
- }, r.decodeDelimited = function(e) {
1605
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1606
- }, r.verify = function(e) {
1607
- if (typeof e != "object" || e === null) return "object expected";
1608
- if (e.roomId != null && e.hasOwnProperty("roomId") && !$util.isString(e.roomId)) return "roomId: string expected";
1609
- if (e.type != null && e.hasOwnProperty("type"))
1610
- switch (e.type) {
1757
+ return c;
1758
+ }, n.decodeDelimited = function(t) {
1759
+ return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
1760
+ }, n.verify = function(t) {
1761
+ if (typeof t != "object" || t === null) return "object expected";
1762
+ if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
1763
+ if (t.type != null && t.hasOwnProperty("type"))
1764
+ switch (t.type) {
1611
1765
  default:
1612
1766
  return "type: enum value expected";
1613
1767
  case 0:
@@ -1615,440 +1769,440 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1615
1769
  case 2:
1616
1770
  break;
1617
1771
  }
1618
- if (e.userMap != null && e.hasOwnProperty("userMap")) {
1619
- if (!$util.isObject(e.userMap)) return "userMap: object expected";
1620
- let t = Object.keys(e.userMap);
1621
- for (let s = 0; s < t.length; ++s) {
1622
- let l = $root.com.quick.voice.proto.UserInfo.verify(e.userMap[t[s]]);
1772
+ if (t.userMap != null && t.hasOwnProperty("userMap")) {
1773
+ if (!$util.isObject(t.userMap)) return "userMap: object expected";
1774
+ let e = Object.keys(t.userMap);
1775
+ for (let s = 0; s < e.length; ++s) {
1776
+ let l = $root.com.quick.voice.proto.UserInfo.verify(t.userMap[e[s]]);
1623
1777
  if (l) return "userMap." + l;
1624
1778
  }
1625
1779
  }
1626
- if (e.globalCustom != null && e.hasOwnProperty("globalCustom")) {
1627
- let t = $root.com.quick.voice.proto.CustomInfo.verify(e.globalCustom);
1628
- if (t) return "globalCustom." + t;
1780
+ if (t.globalCustom != null && t.hasOwnProperty("globalCustom")) {
1781
+ let e = $root.com.quick.voice.proto.CustomInfo.verify(t.globalCustom);
1782
+ if (e) return "globalCustom." + e;
1629
1783
  }
1630
1784
  return null;
1631
- }, r.fromObject = function(e) {
1632
- if (e instanceof $root.com.quick.voice.proto.LayoutData) return e;
1633
- let t = new $root.com.quick.voice.proto.LayoutData();
1634
- switch (e.roomId != null && (t.roomId = String(e.roomId)), e.type) {
1785
+ }, n.fromObject = function(t) {
1786
+ if (t instanceof $root.com.quick.voice.proto.LayoutData) return t;
1787
+ let e = new $root.com.quick.voice.proto.LayoutData();
1788
+ switch (t.roomId != null && (e.roomId = String(t.roomId)), t.type) {
1635
1789
  default:
1636
- if (typeof e.type == "number") {
1637
- t.type = e.type;
1790
+ if (typeof t.type == "number") {
1791
+ e.type = t.type;
1638
1792
  break;
1639
1793
  }
1640
1794
  break;
1641
1795
  case "AudioAndVideo":
1642
1796
  case 0:
1643
- t.type = 0;
1797
+ e.type = 0;
1644
1798
  break;
1645
1799
  case "OnlyAudio":
1646
1800
  case 1:
1647
- t.type = 1;
1801
+ e.type = 1;
1648
1802
  break;
1649
1803
  case "OnlyVideo":
1650
1804
  case 2:
1651
- t.type = 2;
1805
+ e.type = 2;
1652
1806
  break;
1653
1807
  }
1654
- if (e.userMap) {
1655
- if (typeof e.userMap != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
1656
- t.userMap = {};
1657
- for (let s = Object.keys(e.userMap), l = 0; l < s.length; ++l) {
1658
- if (typeof e.userMap[s[l]] != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
1659
- t.userMap[s[l]] = $root.com.quick.voice.proto.UserInfo.fromObject(e.userMap[s[l]]);
1808
+ if (t.userMap) {
1809
+ if (typeof t.userMap != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
1810
+ e.userMap = {};
1811
+ for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l) {
1812
+ if (typeof t.userMap[s[l]] != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
1813
+ e.userMap[s[l]] = $root.com.quick.voice.proto.UserInfo.fromObject(t.userMap[s[l]]);
1660
1814
  }
1661
1815
  }
1662
- if (e.globalCustom != null) {
1663
- if (typeof e.globalCustom != "object") throw TypeError(".com.quick.voice.proto.LayoutData.globalCustom: object expected");
1664
- t.globalCustom = $root.com.quick.voice.proto.CustomInfo.fromObject(e.globalCustom);
1816
+ if (t.globalCustom != null) {
1817
+ if (typeof t.globalCustom != "object") throw TypeError(".com.quick.voice.proto.LayoutData.globalCustom: object expected");
1818
+ e.globalCustom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.globalCustom);
1665
1819
  }
1666
- return t;
1667
- }, r.toObject = function(e, t) {
1668
- t || (t = {});
1820
+ return e;
1821
+ }, n.toObject = function(t, e) {
1822
+ e || (e = {});
1669
1823
  let s = {};
1670
- (t.objects || t.defaults) && (s.userMap = {}), t.defaults && (s.roomId = "", s.type = t.enums === String ? "AudioAndVideo" : 0), e.roomId != null && e.hasOwnProperty("roomId") && (s.roomId = e.roomId), e.type != null && e.hasOwnProperty("type") && (s.type = t.enums === String ? $root.com.quick.voice.proto.LayoutType[e.type] === void 0 ? e.type : $root.com.quick.voice.proto.LayoutType[e.type] : e.type);
1824
+ (e.objects || e.defaults) && (s.userMap = {}), e.defaults && (s.roomId = "", s.type = e.enums === String ? "AudioAndVideo" : 0), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.LayoutType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.LayoutType[t.type] : t.type);
1671
1825
  let l;
1672
- if (e.userMap && (l = Object.keys(e.userMap)).length) {
1826
+ if (t.userMap && (l = Object.keys(t.userMap)).length) {
1673
1827
  s.userMap = {};
1674
- for (let a = 0; a < l.length; ++a) s.userMap[l[a]] = $root.com.quick.voice.proto.UserInfo.toObject(e.userMap[l[a]], t);
1828
+ for (let c = 0; c < l.length; ++c) s.userMap[l[c]] = $root.com.quick.voice.proto.UserInfo.toObject(t.userMap[l[c]], e);
1675
1829
  }
1676
- return e.globalCustom != null && e.hasOwnProperty("globalCustom") && (s.globalCustom = $root.com.quick.voice.proto.CustomInfo.toObject(e.globalCustom, t), t.oneofs && (s._globalCustom = "globalCustom")), s;
1677
- }, r.prototype.toJSON = function() {
1830
+ return t.globalCustom != null && t.hasOwnProperty("globalCustom") && (s.globalCustom = $root.com.quick.voice.proto.CustomInfo.toObject(t.globalCustom, e), e.oneofs && (s._globalCustom = "globalCustom")), s;
1831
+ }, n.prototype.toJSON = function() {
1678
1832
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
1679
- }, r.getTypeUrl = function(e) {
1680
- return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.LayoutData";
1681
- }, r;
1682
- }(), c.UserInfo = function() {
1683
- function r(i) {
1684
- if (this.audios = [], this.videos = [], i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
1833
+ }, n.getTypeUrl = function(t) {
1834
+ return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.LayoutData";
1835
+ }, n;
1836
+ }(), u.UserInfo = function() {
1837
+ function n(i) {
1838
+ if (this.audios = [], this.videos = [], i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
1685
1839
  }
1686
- r.prototype.id = "", r.prototype.audios = $util.emptyArray, r.prototype.videos = $util.emptyArray, r.prototype.custom = null;
1687
- let n;
1688
- return Object.defineProperty(r.prototype, "_custom", {
1689
- get: $util.oneOfGetter(n = ["custom"]),
1690
- set: $util.oneOfSetter(n)
1691
- }), r.create = function(e) {
1692
- return new r(e);
1693
- }, r.encode = function(e, t) {
1694
- if (t || (t = $Writer.create()), e.id != null && Object.hasOwnProperty.call(e, "id") && t.uint32(
1840
+ n.prototype.id = "", n.prototype.audios = $util.emptyArray, n.prototype.videos = $util.emptyArray, n.prototype.custom = null;
1841
+ let r;
1842
+ return Object.defineProperty(n.prototype, "_custom", {
1843
+ get: $util.oneOfGetter(r = ["custom"]),
1844
+ set: $util.oneOfSetter(r)
1845
+ }), n.create = function(t) {
1846
+ return new n(t);
1847
+ }, n.encode = function(t, e) {
1848
+ if (e || (e = $Writer.create()), t.id != null && Object.hasOwnProperty.call(t, "id") && e.uint32(
1695
1849
  /* id 1, wireType 2 =*/
1696
1850
  10
1697
- ).string(e.id), e.audios != null && e.audios.length) for (let s = 0; s < e.audios.length; ++s) $root.com.quick.voice.proto.AudioInfo.encode(e.audios[s], t.uint32(
1851
+ ).string(t.id), t.audios != null && t.audios.length) for (let s = 0; s < t.audios.length; ++s) $root.com.quick.voice.proto.AudioInfo.encode(t.audios[s], e.uint32(
1698
1852
  /* id 2, wireType 2 =*/
1699
1853
  18
1700
1854
  ).fork()).ldelim();
1701
- if (e.videos != null && e.videos.length) for (let s = 0; s < e.videos.length; ++s) $root.com.quick.voice.proto.VideoInfo.encode(e.videos[s], t.uint32(
1855
+ if (t.videos != null && t.videos.length) for (let s = 0; s < t.videos.length; ++s) $root.com.quick.voice.proto.VideoInfo.encode(t.videos[s], e.uint32(
1702
1856
  /* id 3, wireType 2 =*/
1703
1857
  26
1704
1858
  ).fork()).ldelim();
1705
- return e.custom != null && Object.hasOwnProperty.call(e, "custom") && $root.com.quick.voice.proto.CustomInfo.encode(e.custom, t.uint32(
1859
+ return t.custom != null && Object.hasOwnProperty.call(t, "custom") && $root.com.quick.voice.proto.CustomInfo.encode(t.custom, e.uint32(
1706
1860
  /* id 4, wireType 2 =*/
1707
1861
  34
1708
- ).fork()).ldelim(), t;
1709
- }, r.encodeDelimited = function(e, t) {
1710
- return this.encode(e, t).ldelim();
1711
- }, r.decode = function(e, t, s) {
1712
- e instanceof $Reader || (e = $Reader.create(e));
1713
- let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.UserInfo();
1714
- for (; e.pos < l; ) {
1715
- let d = e.uint32();
1862
+ ).fork()).ldelim(), e;
1863
+ }, n.encodeDelimited = function(t, e) {
1864
+ return this.encode(t, e).ldelim();
1865
+ }, n.decode = function(t, e, s) {
1866
+ t instanceof $Reader || (t = $Reader.create(t));
1867
+ let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.UserInfo();
1868
+ for (; t.pos < l; ) {
1869
+ let d = t.uint32();
1716
1870
  if (d === s) break;
1717
1871
  switch (d >>> 3) {
1718
1872
  case 1: {
1719
- a.id = e.string();
1873
+ c.id = t.string();
1720
1874
  break;
1721
1875
  }
1722
1876
  case 2: {
1723
- a.audios && a.audios.length || (a.audios = []), a.audios.push($root.com.quick.voice.proto.AudioInfo.decode(e, e.uint32()));
1877
+ c.audios && c.audios.length || (c.audios = []), c.audios.push($root.com.quick.voice.proto.AudioInfo.decode(t, t.uint32()));
1724
1878
  break;
1725
1879
  }
1726
1880
  case 3: {
1727
- a.videos && a.videos.length || (a.videos = []), a.videos.push($root.com.quick.voice.proto.VideoInfo.decode(e, e.uint32()));
1881
+ c.videos && c.videos.length || (c.videos = []), c.videos.push($root.com.quick.voice.proto.VideoInfo.decode(t, t.uint32()));
1728
1882
  break;
1729
1883
  }
1730
1884
  case 4: {
1731
- a.custom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1885
+ c.custom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
1732
1886
  break;
1733
1887
  }
1734
1888
  default:
1735
- e.skipType(d & 7);
1889
+ t.skipType(d & 7);
1736
1890
  break;
1737
1891
  }
1738
1892
  }
1739
- return a;
1740
- }, r.decodeDelimited = function(e) {
1741
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1742
- }, r.verify = function(e) {
1743
- if (typeof e != "object" || e === null) return "object expected";
1744
- if (e.id != null && e.hasOwnProperty("id") && !$util.isString(e.id)) return "id: string expected";
1745
- if (e.audios != null && e.hasOwnProperty("audios")) {
1746
- if (!Array.isArray(e.audios)) return "audios: array expected";
1747
- for (let t = 0; t < e.audios.length; ++t) {
1748
- let s = $root.com.quick.voice.proto.AudioInfo.verify(e.audios[t]);
1893
+ return c;
1894
+ }, n.decodeDelimited = function(t) {
1895
+ return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
1896
+ }, n.verify = function(t) {
1897
+ if (typeof t != "object" || t === null) return "object expected";
1898
+ if (t.id != null && t.hasOwnProperty("id") && !$util.isString(t.id)) return "id: string expected";
1899
+ if (t.audios != null && t.hasOwnProperty("audios")) {
1900
+ if (!Array.isArray(t.audios)) return "audios: array expected";
1901
+ for (let e = 0; e < t.audios.length; ++e) {
1902
+ let s = $root.com.quick.voice.proto.AudioInfo.verify(t.audios[e]);
1749
1903
  if (s) return "audios." + s;
1750
1904
  }
1751
1905
  }
1752
- if (e.videos != null && e.hasOwnProperty("videos")) {
1753
- if (!Array.isArray(e.videos)) return "videos: array expected";
1754
- for (let t = 0; t < e.videos.length; ++t) {
1755
- let s = $root.com.quick.voice.proto.VideoInfo.verify(e.videos[t]);
1906
+ if (t.videos != null && t.hasOwnProperty("videos")) {
1907
+ if (!Array.isArray(t.videos)) return "videos: array expected";
1908
+ for (let e = 0; e < t.videos.length; ++e) {
1909
+ let s = $root.com.quick.voice.proto.VideoInfo.verify(t.videos[e]);
1756
1910
  if (s) return "videos." + s;
1757
1911
  }
1758
1912
  }
1759
- if (e.custom != null && e.hasOwnProperty("custom")) {
1760
- let t = $root.com.quick.voice.proto.CustomInfo.verify(e.custom);
1761
- if (t) return "custom." + t;
1913
+ if (t.custom != null && t.hasOwnProperty("custom")) {
1914
+ let e = $root.com.quick.voice.proto.CustomInfo.verify(t.custom);
1915
+ if (e) return "custom." + e;
1762
1916
  }
1763
1917
  return null;
1764
- }, r.fromObject = function(e) {
1765
- if (e instanceof $root.com.quick.voice.proto.UserInfo) return e;
1766
- let t = new $root.com.quick.voice.proto.UserInfo();
1767
- if (e.id != null && (t.id = String(e.id)), e.audios) {
1768
- if (!Array.isArray(e.audios)) throw TypeError(".com.quick.voice.proto.UserInfo.audios: array expected");
1769
- t.audios = [];
1770
- for (let s = 0; s < e.audios.length; ++s) {
1771
- if (typeof e.audios[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.audios: object expected");
1772
- t.audios[s] = $root.com.quick.voice.proto.AudioInfo.fromObject(e.audios[s]);
1918
+ }, n.fromObject = function(t) {
1919
+ if (t instanceof $root.com.quick.voice.proto.UserInfo) return t;
1920
+ let e = new $root.com.quick.voice.proto.UserInfo();
1921
+ if (t.id != null && (e.id = String(t.id)), t.audios) {
1922
+ if (!Array.isArray(t.audios)) throw TypeError(".com.quick.voice.proto.UserInfo.audios: array expected");
1923
+ e.audios = [];
1924
+ for (let s = 0; s < t.audios.length; ++s) {
1925
+ if (typeof t.audios[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.audios: object expected");
1926
+ e.audios[s] = $root.com.quick.voice.proto.AudioInfo.fromObject(t.audios[s]);
1773
1927
  }
1774
1928
  }
1775
- if (e.videos) {
1776
- if (!Array.isArray(e.videos)) throw TypeError(".com.quick.voice.proto.UserInfo.videos: array expected");
1777
- t.videos = [];
1778
- for (let s = 0; s < e.videos.length; ++s) {
1779
- if (typeof e.videos[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.videos: object expected");
1780
- t.videos[s] = $root.com.quick.voice.proto.VideoInfo.fromObject(e.videos[s]);
1929
+ if (t.videos) {
1930
+ if (!Array.isArray(t.videos)) throw TypeError(".com.quick.voice.proto.UserInfo.videos: array expected");
1931
+ e.videos = [];
1932
+ for (let s = 0; s < t.videos.length; ++s) {
1933
+ if (typeof t.videos[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.videos: object expected");
1934
+ e.videos[s] = $root.com.quick.voice.proto.VideoInfo.fromObject(t.videos[s]);
1781
1935
  }
1782
1936
  }
1783
- if (e.custom != null) {
1784
- if (typeof e.custom != "object") throw TypeError(".com.quick.voice.proto.UserInfo.custom: object expected");
1785
- t.custom = $root.com.quick.voice.proto.CustomInfo.fromObject(e.custom);
1937
+ if (t.custom != null) {
1938
+ if (typeof t.custom != "object") throw TypeError(".com.quick.voice.proto.UserInfo.custom: object expected");
1939
+ e.custom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.custom);
1786
1940
  }
1787
- return t;
1788
- }, r.toObject = function(e, t) {
1789
- t || (t = {});
1941
+ return e;
1942
+ }, n.toObject = function(t, e) {
1943
+ e || (e = {});
1790
1944
  let s = {};
1791
- if ((t.arrays || t.defaults) && (s.audios = [], s.videos = []), t.defaults && (s.id = ""), e.id != null && e.hasOwnProperty("id") && (s.id = e.id), e.audios && e.audios.length) {
1945
+ if ((e.arrays || e.defaults) && (s.audios = [], s.videos = []), e.defaults && (s.id = ""), t.id != null && t.hasOwnProperty("id") && (s.id = t.id), t.audios && t.audios.length) {
1792
1946
  s.audios = [];
1793
- for (let l = 0; l < e.audios.length; ++l) s.audios[l] = $root.com.quick.voice.proto.AudioInfo.toObject(e.audios[l], t);
1947
+ for (let l = 0; l < t.audios.length; ++l) s.audios[l] = $root.com.quick.voice.proto.AudioInfo.toObject(t.audios[l], e);
1794
1948
  }
1795
- if (e.videos && e.videos.length) {
1949
+ if (t.videos && t.videos.length) {
1796
1950
  s.videos = [];
1797
- for (let l = 0; l < e.videos.length; ++l) s.videos[l] = $root.com.quick.voice.proto.VideoInfo.toObject(e.videos[l], t);
1951
+ for (let l = 0; l < t.videos.length; ++l) s.videos[l] = $root.com.quick.voice.proto.VideoInfo.toObject(t.videos[l], e);
1798
1952
  }
1799
- return e.custom != null && e.hasOwnProperty("custom") && (s.custom = $root.com.quick.voice.proto.CustomInfo.toObject(e.custom, t), t.oneofs && (s._custom = "custom")), s;
1800
- }, r.prototype.toJSON = function() {
1953
+ return t.custom != null && t.hasOwnProperty("custom") && (s.custom = $root.com.quick.voice.proto.CustomInfo.toObject(t.custom, e), e.oneofs && (s._custom = "custom")), s;
1954
+ }, n.prototype.toJSON = function() {
1801
1955
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
1802
- }, r.getTypeUrl = function(e) {
1803
- return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.UserInfo";
1804
- }, r;
1805
- }(), c.AudioInfo = function() {
1806
- function r(i) {
1807
- if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
1956
+ }, n.getTypeUrl = function(t) {
1957
+ return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.UserInfo";
1958
+ }, n;
1959
+ }(), u.AudioInfo = function() {
1960
+ function n(i) {
1961
+ if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
1808
1962
  }
1809
- r.prototype.type = 0, r.prototype.isEnable = !1, r.prototype.isMute = !1, r.prototype.volume = 0, r.prototype.updateTime = null;
1810
- let n;
1811
- return Object.defineProperty(r.prototype, "_updateTime", {
1812
- get: $util.oneOfGetter(n = ["updateTime"]),
1813
- set: $util.oneOfSetter(n)
1814
- }), r.create = function(e) {
1815
- return new r(e);
1816
- }, r.encode = function(e, t) {
1817
- return t || (t = $Writer.create()), e.type != null && Object.hasOwnProperty.call(e, "type") && t.uint32(
1963
+ n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.volume = 0, n.prototype.updateTime = null;
1964
+ let r;
1965
+ return Object.defineProperty(n.prototype, "_updateTime", {
1966
+ get: $util.oneOfGetter(r = ["updateTime"]),
1967
+ set: $util.oneOfSetter(r)
1968
+ }), n.create = function(t) {
1969
+ return new n(t);
1970
+ }, n.encode = function(t, e) {
1971
+ return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
1818
1972
  /* id 1, wireType 0 =*/
1819
1973
  8
1820
- ).int32(e.type), e.isEnable != null && Object.hasOwnProperty.call(e, "isEnable") && t.uint32(
1974
+ ).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
1821
1975
  /* id 2, wireType 0 =*/
1822
1976
  16
1823
- ).bool(e.isEnable), e.isMute != null && Object.hasOwnProperty.call(e, "isMute") && t.uint32(
1977
+ ).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
1824
1978
  /* id 3, wireType 0 =*/
1825
1979
  24
1826
- ).bool(e.isMute), e.volume != null && Object.hasOwnProperty.call(e, "volume") && t.uint32(
1980
+ ).bool(t.isMute), t.volume != null && Object.hasOwnProperty.call(t, "volume") && e.uint32(
1827
1981
  /* id 4, wireType 1 =*/
1828
1982
  33
1829
- ).double(e.volume), e.updateTime != null && Object.hasOwnProperty.call(e, "updateTime") && t.uint32(
1983
+ ).double(t.volume), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
1830
1984
  /* id 5, wireType 0 =*/
1831
1985
  40
1832
- ).int64(e.updateTime), t;
1833
- }, r.encodeDelimited = function(e, t) {
1834
- return this.encode(e, t).ldelim();
1835
- }, r.decode = function(e, t, s) {
1836
- e instanceof $Reader || (e = $Reader.create(e));
1837
- let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.AudioInfo();
1838
- for (; e.pos < l; ) {
1839
- let d = e.uint32();
1986
+ ).int64(t.updateTime), e;
1987
+ }, n.encodeDelimited = function(t, e) {
1988
+ return this.encode(t, e).ldelim();
1989
+ }, n.decode = function(t, e, s) {
1990
+ t instanceof $Reader || (t = $Reader.create(t));
1991
+ let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.AudioInfo();
1992
+ for (; t.pos < l; ) {
1993
+ let d = t.uint32();
1840
1994
  if (d === s) break;
1841
1995
  switch (d >>> 3) {
1842
1996
  case 1: {
1843
- a.type = e.int32();
1997
+ c.type = t.int32();
1844
1998
  break;
1845
1999
  }
1846
2000
  case 2: {
1847
- a.isEnable = e.bool();
2001
+ c.isEnable = t.bool();
1848
2002
  break;
1849
2003
  }
1850
2004
  case 3: {
1851
- a.isMute = e.bool();
2005
+ c.isMute = t.bool();
1852
2006
  break;
1853
2007
  }
1854
2008
  case 4: {
1855
- a.volume = e.double();
2009
+ c.volume = t.double();
1856
2010
  break;
1857
2011
  }
1858
2012
  case 5: {
1859
- a.updateTime = e.int64();
2013
+ c.updateTime = t.int64();
1860
2014
  break;
1861
2015
  }
1862
2016
  default:
1863
- e.skipType(d & 7);
2017
+ t.skipType(d & 7);
1864
2018
  break;
1865
2019
  }
1866
2020
  }
1867
- return a;
1868
- }, r.decodeDelimited = function(e) {
1869
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1870
- }, r.verify = function(e) {
1871
- if (typeof e != "object" || e === null) return "object expected";
1872
- if (e.type != null && e.hasOwnProperty("type"))
1873
- switch (e.type) {
2021
+ return c;
2022
+ }, n.decodeDelimited = function(t) {
2023
+ return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
2024
+ }, n.verify = function(t) {
2025
+ if (typeof t != "object" || t === null) return "object expected";
2026
+ if (t.type != null && t.hasOwnProperty("type"))
2027
+ switch (t.type) {
1874
2028
  default:
1875
2029
  return "type: enum value expected";
1876
2030
  case 0:
1877
2031
  case 1:
1878
2032
  break;
1879
2033
  }
1880
- return e.isEnable != null && e.hasOwnProperty("isEnable") && typeof e.isEnable != "boolean" ? "isEnable: boolean expected" : e.isMute != null && e.hasOwnProperty("isMute") && typeof e.isMute != "boolean" ? "isMute: boolean expected" : e.volume != null && e.hasOwnProperty("volume") && typeof e.volume != "number" ? "volume: number expected" : e.updateTime != null && e.hasOwnProperty("updateTime") && !$util.isInteger(e.updateTime) && !(e.updateTime && $util.isInteger(e.updateTime.low) && $util.isInteger(e.updateTime.high)) ? "updateTime: integer|Long expected" : null;
1881
- }, r.fromObject = function(e) {
1882
- if (e instanceof $root.com.quick.voice.proto.AudioInfo) return e;
1883
- let t = new $root.com.quick.voice.proto.AudioInfo();
1884
- switch (e.type) {
2034
+ return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.volume != null && t.hasOwnProperty("volume") && typeof t.volume != "number" ? "volume: number expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
2035
+ }, n.fromObject = function(t) {
2036
+ if (t instanceof $root.com.quick.voice.proto.AudioInfo) return t;
2037
+ let e = new $root.com.quick.voice.proto.AudioInfo();
2038
+ switch (t.type) {
1885
2039
  default:
1886
- if (typeof e.type == "number") {
1887
- t.type = e.type;
2040
+ if (typeof t.type == "number") {
2041
+ e.type = t.type;
1888
2042
  break;
1889
2043
  }
1890
2044
  break;
1891
2045
  case "Microphone":
1892
2046
  case 0:
1893
- t.type = 0;
2047
+ e.type = 0;
1894
2048
  break;
1895
2049
  case "SystemVoice":
1896
2050
  case 1:
1897
- t.type = 1;
2051
+ e.type = 1;
1898
2052
  break;
1899
2053
  }
1900
- return e.isEnable != null && (t.isEnable = !!e.isEnable), e.isMute != null && (t.isMute = !!e.isMute), e.volume != null && (t.volume = Number(e.volume)), e.updateTime != null && ($util.Long ? (t.updateTime = $util.Long.fromValue(e.updateTime)).unsigned = !1 : typeof e.updateTime == "string" ? t.updateTime = parseInt(e.updateTime, 10) : typeof e.updateTime == "number" ? t.updateTime = e.updateTime : typeof e.updateTime == "object" && (t.updateTime = new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber())), t;
1901
- }, r.toObject = function(e, t) {
1902
- t || (t = {});
2054
+ return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.volume != null && (e.volume = Number(t.volume)), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
2055
+ }, n.toObject = function(t, e) {
2056
+ e || (e = {});
1903
2057
  let s = {};
1904
- return t.defaults && (s.type = t.enums === String ? "Microphone" : 0, s.isEnable = !1, s.isMute = !1, s.volume = 0), e.type != null && e.hasOwnProperty("type") && (s.type = t.enums === String ? $root.com.quick.voice.proto.AudioType[e.type] === void 0 ? e.type : $root.com.quick.voice.proto.AudioType[e.type] : e.type), e.isEnable != null && e.hasOwnProperty("isEnable") && (s.isEnable = e.isEnable), e.isMute != null && e.hasOwnProperty("isMute") && (s.isMute = e.isMute), e.volume != null && e.hasOwnProperty("volume") && (s.volume = t.json && !isFinite(e.volume) ? String(e.volume) : e.volume), e.updateTime != null && e.hasOwnProperty("updateTime") && (typeof e.updateTime == "number" ? s.updateTime = t.longs === String ? String(e.updateTime) : e.updateTime : s.updateTime = t.longs === String ? $util.Long.prototype.toString.call(e.updateTime) : t.longs === Number ? new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber() : e.updateTime, t.oneofs && (s._updateTime = "updateTime")), s;
1905
- }, r.prototype.toJSON = function() {
2058
+ return e.defaults && (s.type = e.enums === String ? "Microphone" : 0, s.isEnable = !1, s.isMute = !1, s.volume = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.AudioType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.AudioType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.volume != null && t.hasOwnProperty("volume") && (s.volume = e.json && !isFinite(t.volume) ? String(t.volume) : t.volume), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
2059
+ }, n.prototype.toJSON = function() {
1906
2060
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
1907
- }, r.getTypeUrl = function(e) {
1908
- return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.AudioInfo";
1909
- }, r;
1910
- }(), c.VideoInfo = function() {
1911
- function r(i) {
1912
- if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
2061
+ }, n.getTypeUrl = function(t) {
2062
+ return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.AudioInfo";
2063
+ }, n;
2064
+ }(), u.VideoInfo = function() {
2065
+ function n(i) {
2066
+ if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
1913
2067
  }
1914
- r.prototype.type = 0, r.prototype.isEnable = !1, r.prototype.isMute = !1, r.prototype.width = 0, r.prototype.height = 0, r.prototype.x = 0, r.prototype.y = 0, r.prototype.updateTime = null;
1915
- let n;
1916
- return Object.defineProperty(r.prototype, "_updateTime", {
1917
- get: $util.oneOfGetter(n = ["updateTime"]),
1918
- set: $util.oneOfSetter(n)
1919
- }), r.create = function(e) {
1920
- return new r(e);
1921
- }, r.encode = function(e, t) {
1922
- return t || (t = $Writer.create()), e.type != null && Object.hasOwnProperty.call(e, "type") && t.uint32(
2068
+ n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.width = 0, n.prototype.height = 0, n.prototype.x = 0, n.prototype.y = 0, n.prototype.updateTime = null;
2069
+ let r;
2070
+ return Object.defineProperty(n.prototype, "_updateTime", {
2071
+ get: $util.oneOfGetter(r = ["updateTime"]),
2072
+ set: $util.oneOfSetter(r)
2073
+ }), n.create = function(t) {
2074
+ return new n(t);
2075
+ }, n.encode = function(t, e) {
2076
+ return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
1923
2077
  /* id 1, wireType 0 =*/
1924
2078
  8
1925
- ).int32(e.type), e.isEnable != null && Object.hasOwnProperty.call(e, "isEnable") && t.uint32(
2079
+ ).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
1926
2080
  /* id 2, wireType 0 =*/
1927
2081
  16
1928
- ).bool(e.isEnable), e.isMute != null && Object.hasOwnProperty.call(e, "isMute") && t.uint32(
2082
+ ).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
1929
2083
  /* id 3, wireType 0 =*/
1930
2084
  24
1931
- ).bool(e.isMute), e.width != null && Object.hasOwnProperty.call(e, "width") && t.uint32(
2085
+ ).bool(t.isMute), t.width != null && Object.hasOwnProperty.call(t, "width") && e.uint32(
1932
2086
  /* id 4, wireType 0 =*/
1933
2087
  32
1934
- ).int32(e.width), e.height != null && Object.hasOwnProperty.call(e, "height") && t.uint32(
2088
+ ).int32(t.width), t.height != null && Object.hasOwnProperty.call(t, "height") && e.uint32(
1935
2089
  /* id 5, wireType 0 =*/
1936
2090
  40
1937
- ).int32(e.height), e.x != null && Object.hasOwnProperty.call(e, "x") && t.uint32(
2091
+ ).int32(t.height), t.x != null && Object.hasOwnProperty.call(t, "x") && e.uint32(
1938
2092
  /* id 6, wireType 0 =*/
1939
2093
  48
1940
- ).int32(e.x), e.y != null && Object.hasOwnProperty.call(e, "y") && t.uint32(
2094
+ ).int32(t.x), t.y != null && Object.hasOwnProperty.call(t, "y") && e.uint32(
1941
2095
  /* id 7, wireType 0 =*/
1942
2096
  56
1943
- ).int32(e.y), e.updateTime != null && Object.hasOwnProperty.call(e, "updateTime") && t.uint32(
2097
+ ).int32(t.y), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
1944
2098
  /* id 8, wireType 0 =*/
1945
2099
  64
1946
- ).int64(e.updateTime), t;
1947
- }, r.encodeDelimited = function(e, t) {
1948
- return this.encode(e, t).ldelim();
1949
- }, r.decode = function(e, t, s) {
1950
- e instanceof $Reader || (e = $Reader.create(e));
1951
- let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.VideoInfo();
1952
- for (; e.pos < l; ) {
1953
- let d = e.uint32();
2100
+ ).int64(t.updateTime), e;
2101
+ }, n.encodeDelimited = function(t, e) {
2102
+ return this.encode(t, e).ldelim();
2103
+ }, n.decode = function(t, e, s) {
2104
+ t instanceof $Reader || (t = $Reader.create(t));
2105
+ let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.VideoInfo();
2106
+ for (; t.pos < l; ) {
2107
+ let d = t.uint32();
1954
2108
  if (d === s) break;
1955
2109
  switch (d >>> 3) {
1956
2110
  case 1: {
1957
- a.type = e.int32();
2111
+ c.type = t.int32();
1958
2112
  break;
1959
2113
  }
1960
2114
  case 2: {
1961
- a.isEnable = e.bool();
2115
+ c.isEnable = t.bool();
1962
2116
  break;
1963
2117
  }
1964
2118
  case 3: {
1965
- a.isMute = e.bool();
2119
+ c.isMute = t.bool();
1966
2120
  break;
1967
2121
  }
1968
2122
  case 4: {
1969
- a.width = e.int32();
2123
+ c.width = t.int32();
1970
2124
  break;
1971
2125
  }
1972
2126
  case 5: {
1973
- a.height = e.int32();
2127
+ c.height = t.int32();
1974
2128
  break;
1975
2129
  }
1976
2130
  case 6: {
1977
- a.x = e.int32();
2131
+ c.x = t.int32();
1978
2132
  break;
1979
2133
  }
1980
2134
  case 7: {
1981
- a.y = e.int32();
2135
+ c.y = t.int32();
1982
2136
  break;
1983
2137
  }
1984
2138
  case 8: {
1985
- a.updateTime = e.int64();
2139
+ c.updateTime = t.int64();
1986
2140
  break;
1987
2141
  }
1988
2142
  default:
1989
- e.skipType(d & 7);
2143
+ t.skipType(d & 7);
1990
2144
  break;
1991
2145
  }
1992
2146
  }
1993
- return a;
1994
- }, r.decodeDelimited = function(e) {
1995
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1996
- }, r.verify = function(e) {
1997
- if (typeof e != "object" || e === null) return "object expected";
1998
- if (e.type != null && e.hasOwnProperty("type"))
1999
- switch (e.type) {
2147
+ return c;
2148
+ }, n.decodeDelimited = function(t) {
2149
+ return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
2150
+ }, n.verify = function(t) {
2151
+ if (typeof t != "object" || t === null) return "object expected";
2152
+ if (t.type != null && t.hasOwnProperty("type"))
2153
+ switch (t.type) {
2000
2154
  default:
2001
2155
  return "type: enum value expected";
2002
2156
  case 0:
2003
2157
  case 1:
2004
2158
  break;
2005
2159
  }
2006
- return e.isEnable != null && e.hasOwnProperty("isEnable") && typeof e.isEnable != "boolean" ? "isEnable: boolean expected" : e.isMute != null && e.hasOwnProperty("isMute") && typeof e.isMute != "boolean" ? "isMute: boolean expected" : e.width != null && e.hasOwnProperty("width") && !$util.isInteger(e.width) ? "width: integer expected" : e.height != null && e.hasOwnProperty("height") && !$util.isInteger(e.height) ? "height: integer expected" : e.x != null && e.hasOwnProperty("x") && !$util.isInteger(e.x) ? "x: integer expected" : e.y != null && e.hasOwnProperty("y") && !$util.isInteger(e.y) ? "y: integer expected" : e.updateTime != null && e.hasOwnProperty("updateTime") && !$util.isInteger(e.updateTime) && !(e.updateTime && $util.isInteger(e.updateTime.low) && $util.isInteger(e.updateTime.high)) ? "updateTime: integer|Long expected" : null;
2007
- }, r.fromObject = function(e) {
2008
- if (e instanceof $root.com.quick.voice.proto.VideoInfo) return e;
2009
- let t = new $root.com.quick.voice.proto.VideoInfo();
2010
- switch (e.type) {
2160
+ return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.width != null && t.hasOwnProperty("width") && !$util.isInteger(t.width) ? "width: integer expected" : t.height != null && t.hasOwnProperty("height") && !$util.isInteger(t.height) ? "height: integer expected" : t.x != null && t.hasOwnProperty("x") && !$util.isInteger(t.x) ? "x: integer expected" : t.y != null && t.hasOwnProperty("y") && !$util.isInteger(t.y) ? "y: integer expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
2161
+ }, n.fromObject = function(t) {
2162
+ if (t instanceof $root.com.quick.voice.proto.VideoInfo) return t;
2163
+ let e = new $root.com.quick.voice.proto.VideoInfo();
2164
+ switch (t.type) {
2011
2165
  default:
2012
- if (typeof e.type == "number") {
2013
- t.type = e.type;
2166
+ if (typeof t.type == "number") {
2167
+ e.type = t.type;
2014
2168
  break;
2015
2169
  }
2016
2170
  break;
2017
2171
  case "Camera":
2018
2172
  case 0:
2019
- t.type = 0;
2173
+ e.type = 0;
2020
2174
  break;
2021
2175
  case "Screen":
2022
2176
  case 1:
2023
- t.type = 1;
2177
+ e.type = 1;
2024
2178
  break;
2025
2179
  }
2026
- return e.isEnable != null && (t.isEnable = !!e.isEnable), e.isMute != null && (t.isMute = !!e.isMute), e.width != null && (t.width = e.width | 0), e.height != null && (t.height = e.height | 0), e.x != null && (t.x = e.x | 0), e.y != null && (t.y = e.y | 0), e.updateTime != null && ($util.Long ? (t.updateTime = $util.Long.fromValue(e.updateTime)).unsigned = !1 : typeof e.updateTime == "string" ? t.updateTime = parseInt(e.updateTime, 10) : typeof e.updateTime == "number" ? t.updateTime = e.updateTime : typeof e.updateTime == "object" && (t.updateTime = new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber())), t;
2027
- }, r.toObject = function(e, t) {
2028
- t || (t = {});
2180
+ return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.width != null && (e.width = t.width | 0), t.height != null && (e.height = t.height | 0), t.x != null && (e.x = t.x | 0), t.y != null && (e.y = t.y | 0), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
2181
+ }, n.toObject = function(t, e) {
2182
+ e || (e = {});
2029
2183
  let s = {};
2030
- return t.defaults && (s.type = t.enums === String ? "Camera" : 0, s.isEnable = !1, s.isMute = !1, s.width = 0, s.height = 0, s.x = 0, s.y = 0), e.type != null && e.hasOwnProperty("type") && (s.type = t.enums === String ? $root.com.quick.voice.proto.VideoType[e.type] === void 0 ? e.type : $root.com.quick.voice.proto.VideoType[e.type] : e.type), e.isEnable != null && e.hasOwnProperty("isEnable") && (s.isEnable = e.isEnable), e.isMute != null && e.hasOwnProperty("isMute") && (s.isMute = e.isMute), e.width != null && e.hasOwnProperty("width") && (s.width = e.width), e.height != null && e.hasOwnProperty("height") && (s.height = e.height), e.x != null && e.hasOwnProperty("x") && (s.x = e.x), e.y != null && e.hasOwnProperty("y") && (s.y = e.y), e.updateTime != null && e.hasOwnProperty("updateTime") && (typeof e.updateTime == "number" ? s.updateTime = t.longs === String ? String(e.updateTime) : e.updateTime : s.updateTime = t.longs === String ? $util.Long.prototype.toString.call(e.updateTime) : t.longs === Number ? new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber() : e.updateTime, t.oneofs && (s._updateTime = "updateTime")), s;
2031
- }, r.prototype.toJSON = function() {
2184
+ return e.defaults && (s.type = e.enums === String ? "Camera" : 0, s.isEnable = !1, s.isMute = !1, s.width = 0, s.height = 0, s.x = 0, s.y = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.VideoType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.VideoType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.width != null && t.hasOwnProperty("width") && (s.width = t.width), t.height != null && t.hasOwnProperty("height") && (s.height = t.height), t.x != null && t.hasOwnProperty("x") && (s.x = t.x), t.y != null && t.hasOwnProperty("y") && (s.y = t.y), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
2185
+ }, n.prototype.toJSON = function() {
2032
2186
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
2033
- }, r.getTypeUrl = function(e) {
2034
- return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.VideoInfo";
2035
- }, r;
2036
- }(), c.CustomInfo = function() {
2037
- function r(i) {
2038
- if (this.customKeyMap = {}, i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
2187
+ }, n.getTypeUrl = function(t) {
2188
+ return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.VideoInfo";
2189
+ }, n;
2190
+ }(), u.CustomInfo = function() {
2191
+ function n(i) {
2192
+ if (this.customKeyMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
2039
2193
  }
2040
- r.prototype.roomId = "", r.prototype.customKeyMap = $util.emptyObject, r.prototype.updateTime = null;
2041
- let n;
2042
- return Object.defineProperty(r.prototype, "_updateTime", {
2043
- get: $util.oneOfGetter(n = ["updateTime"]),
2044
- set: $util.oneOfSetter(n)
2045
- }), r.create = function(e) {
2046
- return new r(e);
2047
- }, r.encode = function(e, t) {
2048
- if (t || (t = $Writer.create()), e.roomId != null && Object.hasOwnProperty.call(e, "roomId") && t.uint32(
2194
+ n.prototype.roomId = "", n.prototype.customKeyMap = $util.emptyObject, n.prototype.updateTime = null;
2195
+ let r;
2196
+ return Object.defineProperty(n.prototype, "_updateTime", {
2197
+ get: $util.oneOfGetter(r = ["updateTime"]),
2198
+ set: $util.oneOfSetter(r)
2199
+ }), n.create = function(t) {
2200
+ return new n(t);
2201
+ }, n.encode = function(t, e) {
2202
+ if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
2049
2203
  /* id 1, wireType 2 =*/
2050
2204
  10
2051
- ).string(e.roomId), e.customKeyMap != null && Object.hasOwnProperty.call(e, "customKeyMap")) for (let s = Object.keys(e.customKeyMap), l = 0; l < s.length; ++l) t.uint32(
2205
+ ).string(t.roomId), t.customKeyMap != null && Object.hasOwnProperty.call(t, "customKeyMap")) for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.uint32(
2052
2206
  /* id 2, wireType 2 =*/
2053
2207
  18
2054
2208
  ).fork().uint32(
@@ -2057,102 +2211,102 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2057
2211
  ).string(s[l]).uint32(
2058
2212
  /* id 2, wireType 2 =*/
2059
2213
  18
2060
- ).string(e.customKeyMap[s[l]]).ldelim();
2061
- return e.updateTime != null && Object.hasOwnProperty.call(e, "updateTime") && t.uint32(
2214
+ ).string(t.customKeyMap[s[l]]).ldelim();
2215
+ return t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
2062
2216
  /* id 3, wireType 0 =*/
2063
2217
  24
2064
- ).int64(e.updateTime), t;
2065
- }, r.encodeDelimited = function(e, t) {
2066
- return this.encode(e, t).ldelim();
2067
- }, r.decode = function(e, t, s) {
2068
- e instanceof $Reader || (e = $Reader.create(e));
2069
- let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.CustomInfo(), d, y;
2070
- for (; e.pos < l; ) {
2071
- let p = e.uint32();
2218
+ ).int64(t.updateTime), e;
2219
+ }, n.encodeDelimited = function(t, e) {
2220
+ return this.encode(t, e).ldelim();
2221
+ }, n.decode = function(t, e, s) {
2222
+ t instanceof $Reader || (t = $Reader.create(t));
2223
+ let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.CustomInfo(), d, y;
2224
+ for (; t.pos < l; ) {
2225
+ let p = t.uint32();
2072
2226
  if (p === s) break;
2073
2227
  switch (p >>> 3) {
2074
2228
  case 1: {
2075
- a.roomId = e.string();
2229
+ c.roomId = t.string();
2076
2230
  break;
2077
2231
  }
2078
2232
  case 2: {
2079
- a.customKeyMap === $util.emptyObject && (a.customKeyMap = {});
2080
- let w = e.uint32() + e.pos;
2081
- for (d = "", y = ""; e.pos < w; ) {
2082
- let b = e.uint32();
2233
+ c.customKeyMap === $util.emptyObject && (c.customKeyMap = {});
2234
+ let w = t.uint32() + t.pos;
2235
+ for (d = "", y = ""; t.pos < w; ) {
2236
+ let b = t.uint32();
2083
2237
  switch (b >>> 3) {
2084
2238
  case 1:
2085
- d = e.string();
2239
+ d = t.string();
2086
2240
  break;
2087
2241
  case 2:
2088
- y = e.string();
2242
+ y = t.string();
2089
2243
  break;
2090
2244
  default:
2091
- e.skipType(b & 7);
2245
+ t.skipType(b & 7);
2092
2246
  break;
2093
2247
  }
2094
2248
  }
2095
- a.customKeyMap[d] = y;
2249
+ c.customKeyMap[d] = y;
2096
2250
  break;
2097
2251
  }
2098
2252
  case 3: {
2099
- a.updateTime = e.int64();
2253
+ c.updateTime = t.int64();
2100
2254
  break;
2101
2255
  }
2102
2256
  default:
2103
- e.skipType(p & 7);
2257
+ t.skipType(p & 7);
2104
2258
  break;
2105
2259
  }
2106
2260
  }
2107
- return a;
2108
- }, r.decodeDelimited = function(e) {
2109
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
2110
- }, r.verify = function(e) {
2111
- if (typeof e != "object" || e === null) return "object expected";
2112
- if (e.roomId != null && e.hasOwnProperty("roomId") && !$util.isString(e.roomId)) return "roomId: string expected";
2113
- if (e.customKeyMap != null && e.hasOwnProperty("customKeyMap")) {
2114
- if (!$util.isObject(e.customKeyMap)) return "customKeyMap: object expected";
2115
- let t = Object.keys(e.customKeyMap);
2116
- for (let s = 0; s < t.length; ++s) if (!$util.isString(e.customKeyMap[t[s]])) return "customKeyMap: string{k:string} expected";
2261
+ return c;
2262
+ }, n.decodeDelimited = function(t) {
2263
+ return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
2264
+ }, n.verify = function(t) {
2265
+ if (typeof t != "object" || t === null) return "object expected";
2266
+ if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
2267
+ if (t.customKeyMap != null && t.hasOwnProperty("customKeyMap")) {
2268
+ if (!$util.isObject(t.customKeyMap)) return "customKeyMap: object expected";
2269
+ let e = Object.keys(t.customKeyMap);
2270
+ for (let s = 0; s < e.length; ++s) if (!$util.isString(t.customKeyMap[e[s]])) return "customKeyMap: string{k:string} expected";
2117
2271
  }
2118
- return e.updateTime != null && e.hasOwnProperty("updateTime") && !$util.isInteger(e.updateTime) && !(e.updateTime && $util.isInteger(e.updateTime.low) && $util.isInteger(e.updateTime.high)) ? "updateTime: integer|Long expected" : null;
2119
- }, r.fromObject = function(e) {
2120
- if (e instanceof $root.com.quick.voice.proto.CustomInfo) return e;
2121
- let t = new $root.com.quick.voice.proto.CustomInfo();
2122
- if (e.roomId != null && (t.roomId = String(e.roomId)), e.customKeyMap) {
2123
- if (typeof e.customKeyMap != "object") throw TypeError(".com.quick.voice.proto.CustomInfo.customKeyMap: object expected");
2124
- t.customKeyMap = {};
2125
- for (let s = Object.keys(e.customKeyMap), l = 0; l < s.length; ++l) t.customKeyMap[s[l]] = String(e.customKeyMap[s[l]]);
2272
+ return t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
2273
+ }, n.fromObject = function(t) {
2274
+ if (t instanceof $root.com.quick.voice.proto.CustomInfo) return t;
2275
+ let e = new $root.com.quick.voice.proto.CustomInfo();
2276
+ if (t.roomId != null && (e.roomId = String(t.roomId)), t.customKeyMap) {
2277
+ if (typeof t.customKeyMap != "object") throw TypeError(".com.quick.voice.proto.CustomInfo.customKeyMap: object expected");
2278
+ e.customKeyMap = {};
2279
+ for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.customKeyMap[s[l]] = String(t.customKeyMap[s[l]]);
2126
2280
  }
2127
- return e.updateTime != null && ($util.Long ? (t.updateTime = $util.Long.fromValue(e.updateTime)).unsigned = !1 : typeof e.updateTime == "string" ? t.updateTime = parseInt(e.updateTime, 10) : typeof e.updateTime == "number" ? t.updateTime = e.updateTime : typeof e.updateTime == "object" && (t.updateTime = new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber())), t;
2128
- }, r.toObject = function(e, t) {
2129
- t || (t = {});
2281
+ return t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
2282
+ }, n.toObject = function(t, e) {
2283
+ e || (e = {});
2130
2284
  let s = {};
2131
- (t.objects || t.defaults) && (s.customKeyMap = {}), t.defaults && (s.roomId = ""), e.roomId != null && e.hasOwnProperty("roomId") && (s.roomId = e.roomId);
2285
+ (e.objects || e.defaults) && (s.customKeyMap = {}), e.defaults && (s.roomId = ""), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId);
2132
2286
  let l;
2133
- if (e.customKeyMap && (l = Object.keys(e.customKeyMap)).length) {
2287
+ if (t.customKeyMap && (l = Object.keys(t.customKeyMap)).length) {
2134
2288
  s.customKeyMap = {};
2135
- for (let a = 0; a < l.length; ++a) s.customKeyMap[l[a]] = e.customKeyMap[l[a]];
2289
+ for (let c = 0; c < l.length; ++c) s.customKeyMap[l[c]] = t.customKeyMap[l[c]];
2136
2290
  }
2137
- return e.updateTime != null && e.hasOwnProperty("updateTime") && (typeof e.updateTime == "number" ? s.updateTime = t.longs === String ? String(e.updateTime) : e.updateTime : s.updateTime = t.longs === String ? $util.Long.prototype.toString.call(e.updateTime) : t.longs === Number ? new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber() : e.updateTime, t.oneofs && (s._updateTime = "updateTime")), s;
2138
- }, r.prototype.toJSON = function() {
2291
+ return t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
2292
+ }, n.prototype.toJSON = function() {
2139
2293
  return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
2140
- }, r.getTypeUrl = function(e) {
2141
- return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.CustomInfo";
2142
- }, r;
2143
- }(), c.LayoutType = function() {
2144
- const r = {}, n = Object.create(r);
2145
- return n[r[0] = "AudioAndVideo"] = 0, n[r[1] = "OnlyAudio"] = 1, n[r[2] = "OnlyVideo"] = 2, n;
2146
- }(), c.AudioType = function() {
2147
- const r = {}, n = Object.create(r);
2148
- return n[r[0] = "Microphone"] = 0, n[r[1] = "SystemVoice"] = 1, n;
2149
- }(), c.VideoType = function() {
2150
- const r = {}, n = Object.create(r);
2151
- return n[r[0] = "Camera"] = 0, n[r[1] = "Screen"] = 1, n;
2152
- }(), c;
2153
- }(), u;
2294
+ }, n.getTypeUrl = function(t) {
2295
+ return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.CustomInfo";
2296
+ }, n;
2297
+ }(), u.LayoutType = function() {
2298
+ const n = {}, r = Object.create(n);
2299
+ return r[n[0] = "AudioAndVideo"] = 0, r[n[1] = "OnlyAudio"] = 1, r[n[2] = "OnlyVideo"] = 2, r;
2300
+ }(), u.AudioType = function() {
2301
+ const n = {}, r = Object.create(n);
2302
+ return r[n[0] = "Microphone"] = 0, r[n[1] = "SystemVoice"] = 1, r;
2303
+ }(), u.VideoType = function() {
2304
+ const n = {}, r = Object.create(n);
2305
+ return r[n[0] = "Camera"] = 0, r[n[1] = "Screen"] = 1, r;
2306
+ }(), u;
2307
+ }(), a;
2154
2308
  }(), o;
2155
- }(), f;
2309
+ }(), h;
2156
2310
  })(), createAudioInfo = () => ({
2157
2311
  remove: !1,
2158
2312
  isEnable: !1,
@@ -2171,28 +2325,28 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2171
2325
  });
2172
2326
  class RoomUser {
2173
2327
  constructor() {
2174
- v(this, "userId", "");
2175
- v(this, "mc_audio");
2328
+ m(this, "userId", "");
2329
+ m(this, "mc_audio");
2176
2330
  // 麦克风
2177
- v(this, "mc_video");
2331
+ m(this, "mc_video");
2178
2332
  // 摄像头
2179
- v(this, "ss_audio");
2333
+ m(this, "ss_audio");
2180
2334
  // 屏幕共享视频
2181
- v(this, "ss_video");
2335
+ m(this, "ss_video");
2182
2336
  // 屏幕共享音频
2183
- v(this, "updateTime", 0);
2184
- v(this, "getUpdateTimeKey", () => {
2337
+ m(this, "updateTime", 0);
2338
+ m(this, "getUpdateTimeKey", () => {
2185
2339
  const o = [];
2186
2340
  return this.mc_audio && o.push(this.mc_audio.updateTime), this.mc_video && o.push(this.mc_video.updateTime), this.ss_audio && o.push(this.ss_audio.updateTime), this.ss_video && o.push(this.ss_video.updateTime), o.join("_");
2187
2341
  });
2188
- v(this, "init", (o) => {
2189
- var e, t, s, l;
2190
- const { id: u, audios: c = [], videos: r = [] } = o;
2191
- this.userId = u;
2192
- const n = this.getUpdateTimeKey();
2342
+ m(this, "init", (o) => {
2343
+ var t, e, s, l;
2344
+ const { id: a, audios: u = [], videos: n = [] } = o;
2345
+ this.userId = a;
2346
+ const r = this.getUpdateTimeKey();
2193
2347
  this.mc_audio && (this.mc_audio.remove = !0), this.mc_video && (this.mc_video.remove = !0), this.ss_audio && (this.ss_audio.remove = !0), this.ss_video && (this.ss_video.remove = !0);
2194
- for (const a of c) {
2195
- const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = a;
2348
+ for (const c of u) {
2349
+ const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = c;
2196
2350
  switch (d) {
2197
2351
  case 0:
2198
2352
  {
@@ -2208,48 +2362,48 @@ class RoomUser {
2208
2362
  break;
2209
2363
  }
2210
2364
  }
2211
- for (const a of r) {
2212
- const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: m, x: g, y: k } = a;
2365
+ for (const c of n) {
2366
+ const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: g, x: k, y: _ } = c;
2213
2367
  switch (d) {
2214
2368
  case 0:
2215
2369
  {
2216
2370
  if (this.mc_video || (this.mc_video = createVideoInfo()), this.mc_video.remove = !1, this.mc_video.updateTime === w) break;
2217
- this.mc_video.isEnable = !!y, this.mc_video.isMute = !!p, this.mc_video.updateTime = Number(w) || 0, this.mc_video.sx = g || 0, this.mc_video.sy = k || 0, this.mc_video.sw = b || 0, this.mc_video.sh = m || 0;
2371
+ this.mc_video.isEnable = !!y, this.mc_video.isMute = !!p, this.mc_video.updateTime = Number(w) || 0, this.mc_video.sx = k || 0, this.mc_video.sy = _ || 0, this.mc_video.sw = b || 0, this.mc_video.sh = g || 0;
2218
2372
  }
2219
2373
  break;
2220
2374
  case 1:
2221
2375
  {
2222
2376
  if (this.ss_video || (this.ss_video = createVideoInfo()), this.ss_video.remove = !1, this.ss_video.updateTime === w) break;
2223
- this.ss_video.isEnable = !!y, this.ss_video.isMute = !!p, this.ss_video.updateTime = Number(w) || 0, this.ss_video.sx = g || 0, this.ss_video.sy = k || 0, this.ss_video.sw = b || 0, this.ss_video.sh = m || 0;
2377
+ this.ss_video.isEnable = !!y, this.ss_video.isMute = !!p, this.ss_video.updateTime = Number(w) || 0, this.ss_video.sx = k || 0, this.ss_video.sy = _ || 0, this.ss_video.sw = b || 0, this.ss_video.sh = g || 0;
2224
2378
  }
2225
2379
  break;
2226
2380
  }
2227
2381
  }
2228
- (e = this.mc_audio) != null && e.remove && (this.mc_audio = void 0), (t = this.mc_video) != null && t.remove && (this.mc_video = void 0), (s = this.ss_audio) != null && s.remove && (this.ss_audio = void 0), (l = this.ss_video) != null && l.remove && (this.ss_video = void 0);
2382
+ (t = this.mc_audio) != null && t.remove && (this.mc_audio = void 0), (e = this.mc_video) != null && e.remove && (this.mc_video = void 0), (s = this.ss_audio) != null && s.remove && (this.ss_audio = void 0), (l = this.ss_video) != null && l.remove && (this.ss_video = void 0);
2229
2383
  const i = this.getUpdateTimeKey();
2230
- n !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
2384
+ r !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
2231
2385
  });
2232
- v(this, "destroy", () => {
2233
- var o, u;
2234
- (o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (u = this.ss_video) != null && u.destroy && this.ss_video.destroy(), this.mc_audio = void 0, this.mc_video = void 0, this.ss_audio = void 0, this.ss_video = void 0;
2386
+ m(this, "destroy", () => {
2387
+ var o, a;
2388
+ (o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (a = this.ss_video) != null && a.destroy && this.ss_video.destroy(), this.mc_audio = void 0, this.mc_video = void 0, this.ss_audio = void 0, this.ss_video = void 0;
2235
2389
  });
2236
2390
  }
2237
2391
  }
2238
- const parseSEI = (f) => {
2239
- let o = 0, u = 0;
2392
+ const parseSEI = (h) => {
2393
+ let o = 0, a = 0;
2240
2394
  for (; ; ) {
2241
- const r = f[o];
2242
- if (u = u + r, o = o + 1, r !== 255) break;
2395
+ const n = h[o];
2396
+ if (a = a + n, o = o + 1, n !== 255) break;
2243
2397
  }
2244
- let c = 0;
2398
+ let u = 0;
2245
2399
  for (; ; ) {
2246
- const r = f[o];
2247
- if (c = c + r, o = o + 1, r !== 255) break;
2400
+ const n = h[o];
2401
+ if (u = u + n, o = o + 1, n !== 255) break;
2248
2402
  }
2249
- if (u === 5) {
2250
- const r = f.slice(o, o + 16), i = Array.from(r, (p) => p.toString(16).padStart(2, "0")).join("");
2403
+ if (a === 5) {
2404
+ const n = h.slice(o, o + 16), i = Array.from(n, (p) => p.toString(16).padStart(2, "0")).join("");
2251
2405
  o = o + 16;
2252
- const e = c - 16, t = f.slice(o, o + e), s = com.quick.voice.proto.SeiData.decode(t), { event: l = 0 } = s, a = s.data;
2406
+ const t = u - 16, e = h.slice(o, o + t), s = com.quick.voice.proto.SeiData.decode(e), { event: l = 0 } = s, c = s.data;
2253
2407
  let d;
2254
2408
  switch (l) {
2255
2409
  case 0:
@@ -2259,65 +2413,65 @@ const parseSEI = (f) => {
2259
2413
  d = com.quick.voice.proto.CustomInfo.decode(s.data);
2260
2414
  break;
2261
2415
  }
2262
- return { uuid: i, ...s, event: l, data_remote: a, data: d };
2416
+ return { uuid: i, ...s, event: l, data_remote: c, data: d };
2263
2417
  }
2264
2418
  };
2265
2419
  class QuickVoPlayer {
2266
2420
  constructor() {
2267
- v(this, "displayMode", "original");
2268
- v(this, "prPlayer", new be());
2269
- v(this, "dom");
2270
- v(this, "room", {
2421
+ m(this, "displayMode", "original");
2422
+ m(this, "prPlayer", new et());
2423
+ m(this, "dom");
2424
+ m(this, "room", {
2271
2425
  roomId: "",
2272
2426
  updateTime: "",
2273
2427
  author: "",
2274
2428
  version: ""
2275
2429
  });
2276
- v(this, "usersMap", /* @__PURE__ */ new Map());
2277
- v(this, "on", {
2430
+ m(this, "usersMap", /* @__PURE__ */ new Map());
2431
+ m(this, "on", {
2278
2432
  users: (o) => {
2279
2433
  }
2280
2434
  });
2281
- v(this, "init", () => {
2435
+ m(this, "init", () => {
2282
2436
  this.prPlayer.init();
2283
2437
  });
2284
- v(this, "start", async (o) => (this.stop(), this.prPlayer.start(o)));
2285
- v(this, "stop", () => {
2438
+ m(this, "start", async (o) => (this.stop(), this.prPlayer.start(o)));
2439
+ m(this, "stop", () => {
2286
2440
  this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
2287
2441
  });
2288
- v(this, "setMute", (o) => {
2442
+ m(this, "setMute", (o) => {
2289
2443
  this.prPlayer.setMute(o);
2290
2444
  });
2291
- v(this, "getStream", () => this.prPlayer.getStream());
2292
- v(this, "getAllUseUpdateKey", () => {
2445
+ m(this, "getStream", () => this.prPlayer.getStream());
2446
+ m(this, "getAllUseUpdateKey", () => {
2293
2447
  const o = [...this.usersMap.values()];
2294
- return Array.from(o, (c) => c.updateTime).join("_");
2448
+ return Array.from(o, (u) => u.updateTime).join("_");
2295
2449
  });
2296
- v(this, "checkAndCreateUser", (o, u) => {
2297
- var c, r;
2450
+ m(this, "checkAndCreateUser", (o, a) => {
2451
+ var u, n;
2298
2452
  if (this.usersMap.has(o)) {
2299
- const n = this.usersMap.get(o);
2300
- if (n == null || n.init(u), n != null && n.mc_video) {
2301
- const { sx: i, sy: e, sw: t, sh: s } = n.mc_video;
2302
- (c = n == null ? void 0 : n.mc_video.worker) == null || c.setCut({ sx: i, sy: e, sw: t, sh: s });
2453
+ const r = this.usersMap.get(o);
2454
+ if (r == null || r.init(a), r != null && r.mc_video) {
2455
+ const { sx: i, sy: t, sw: e, sh: s } = r.mc_video;
2456
+ (u = r == null ? void 0 : r.mc_video.worker) == null || u.setCut({ sx: i, sy: t, sw: e, sh: s });
2303
2457
  }
2304
- if (n != null && n.ss_video) {
2305
- const { sx: i, sy: e, sw: t, sh: s } = n.ss_video;
2306
- (r = n == null ? void 0 : n.ss_video.worker) == null || r.setCut({ sx: i, sy: e, sw: t, sh: s });
2458
+ if (r != null && r.ss_video) {
2459
+ const { sx: i, sy: t, sw: e, sh: s } = r.ss_video;
2460
+ (n = r == null ? void 0 : r.ss_video.worker) == null || n.setCut({ sx: i, sy: t, sw: e, sh: s });
2307
2461
  }
2308
2462
  } else {
2309
- const n = new RoomUser();
2310
- if (this.usersMap.set(o, n), n.init(u), n) {
2311
- if (n.mc_video) {
2312
- const { sx: i, sy: e, sw: t, sh: s } = n.mc_video, l = `${n.userId}_mc_video`, { worker: a, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: e, sw: t, sh: s });
2313
- n.mc_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.mc_video.stream = d, n.mc_video.destroy = () => {
2314
- y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
2463
+ const r = new RoomUser();
2464
+ if (this.usersMap.set(o, r), r.init(a), r) {
2465
+ if (r.mc_video) {
2466
+ const { sx: i, sy: t, sw: e, sh: s } = r.mc_video, l = `${r.userId}_mc_video`, { worker: c, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
2467
+ r.mc_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.mc_video.stream = d, r.mc_video.destroy = () => {
2468
+ y(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
2315
2469
  };
2316
2470
  }
2317
- if (n.ss_video) {
2318
- const { sx: i, sy: e, sw: t, sh: s } = n.ss_video, l = `${n.userId}_ss_video`, { worker: a, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: e, sw: t, sh: s });
2319
- n.ss_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.ss_video.stream = d, n.ss_video.destroy = () => {
2320
- y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
2471
+ if (r.ss_video) {
2472
+ const { sx: i, sy: t, sw: e, sh: s } = r.ss_video, l = `${r.userId}_ss_video`, { worker: c, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
2473
+ r.ss_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.ss_video.stream = d, r.ss_video.destroy = () => {
2474
+ y(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
2321
2475
  };
2322
2476
  }
2323
2477
  }
@@ -2326,66 +2480,67 @@ class QuickVoPlayer {
2326
2480
  /**
2327
2481
  * 监听SEI信息
2328
2482
  */
2329
- v(this, "onSEI", (o) => {
2483
+ m(this, "onSEI", (o) => {
2330
2484
  try {
2331
- const u = parseSEI(o);
2332
- if (!u) return;
2333
- const { event: c, data: r } = u;
2334
- switch (c) {
2485
+ const a = parseSEI(o);
2486
+ if (!a) return;
2487
+ const { event: u, data: n } = a;
2488
+ switch (u) {
2335
2489
  case 0:
2336
2490
  {
2337
- const { roomId: n, userMap: i } = r;
2338
- if (n !== this.room.roomId) return;
2339
- const e = this.getAllUseUpdateKey(), t = Object.keys(i);
2491
+ const { roomId: r, userMap: i } = n;
2492
+ if (r !== this.room.roomId) return;
2493
+ const t = this.getAllUseUpdateKey(), e = Object.keys(i);
2340
2494
  {
2341
2495
  const l = [...this.usersMap.values()];
2342
- for (const a of l)
2343
- t.includes(a.userId) || a == null || a.destroy();
2496
+ for (const c of l)
2497
+ e.includes(c.userId) || c == null || c.destroy();
2344
2498
  }
2345
- for (const l of t) {
2346
- const a = i[l];
2347
- this.checkAndCreateUser(l, a);
2499
+ for (const l of e) {
2500
+ const c = i[l];
2501
+ this.checkAndCreateUser(l, c);
2348
2502
  }
2349
2503
  const s = this.getAllUseUpdateKey();
2350
- if (e !== s && this.on.users) {
2351
- const l = [...this.usersMap.values()], a = Array.from(l, ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: m }) => ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: m }));
2352
- this.on.users(a);
2504
+ if (t !== s && this.on.users) {
2505
+ const l = [...this.usersMap.values()], c = Array.from(l, ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: g }) => ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: g }));
2506
+ this.on.users(c);
2353
2507
  }
2354
2508
  }
2355
2509
  break;
2356
2510
  case 1:
2357
2511
  {
2358
- const { roomId: n, updateTime: i } = r, { author: e, version: t } = r.customKeyMap;
2359
- this.room.roomId = n, this.room.updateTime = i, this.room.author = e, this.room.version = t;
2512
+ const { roomId: r, updateTime: i } = n, { author: t, version: e } = n.customKeyMap;
2513
+ this.room.roomId = r, this.room.updateTime = i, this.room.author = t, this.room.version = e;
2360
2514
  }
2361
2515
  break;
2362
2516
  }
2363
- } catch (u) {
2364
- console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", u);
2517
+ } catch (a) {
2518
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", a);
2365
2519
  }
2366
2520
  });
2367
- v(this, "setDisplayMode", (o) => {
2368
- var u, c, r, n, i, e, t, s;
2521
+ m(this, "setDisplayMode", (o) => {
2522
+ var a, u, n, r, i, t, e, s;
2369
2523
  switch (this.displayMode = o, o) {
2370
2524
  case "original":
2371
2525
  {
2372
2526
  this.prPlayer.setPause(!1);
2373
2527
  const l = [...this.usersMap.values()];
2374
- for (const a of l)
2375
- (c = (u = a.mc_video) == null ? void 0 : u.worker) == null || c.setPause(!0), (n = (r = a.ss_video) == null ? void 0 : r.worker) == null || n.setPause(!0);
2528
+ for (const c of l)
2529
+ (u = (a = c.mc_video) == null ? void 0 : a.worker) == null || u.setPause(!0), (r = (n = c.ss_video) == null ? void 0 : n.worker) == null || r.setPause(!0);
2376
2530
  }
2377
2531
  break;
2378
2532
  case "cut":
2379
2533
  {
2380
2534
  this.prPlayer.setPause(!0);
2381
2535
  const l = [...this.usersMap.values()];
2382
- for (const a of l)
2383
- (e = (i = a.mc_video) == null ? void 0 : i.worker) == null || e.setPause(!1), (s = (t = a.ss_video) == null ? void 0 : t.worker) == null || s.setPause(!1);
2536
+ for (const c of l)
2537
+ (t = (i = c.mc_video) == null ? void 0 : i.worker) == null || t.setPause(!1), (s = (e = c.ss_video) == null ? void 0 : e.worker) == null || s.setPause(!1);
2384
2538
  }
2385
2539
  break;
2386
2540
  }
2387
2541
  });
2388
- this.prPlayer.on.demuxer.sei = this.onSEI;
2542
+ this.prPlayer.on.demuxer.sei = this.onSEI, this.prPlayer.on.demuxer.chunk = (o) => {
2543
+ };
2389
2544
  }
2390
2545
  }
2391
2546
  export {