quickvo-player 0.0.2 → 0.0.3

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,21 +1,21 @@
1
1
  var U = Object.defineProperty;
2
- var P = (f) => {
2
+ var D = (f) => {
3
3
  throw TypeError(f);
4
4
  };
5
- var W = (f, o, a) => o in f ? U(f, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : f[o] = a;
6
- var v = (f, o, a) => W(f, typeof o != "symbol" ? o + "" : o, a), B = (f, o, a) => o.has(f) || P("Cannot " + a);
7
- var x = (f, o, a) => (B(f, o, "read from private field"), a ? a.call(f) : o.get(f)), D = (f, o, a) => o.has(f) ? P("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(f) : o.set(f, a), C = (f, o, a, u) => (B(f, o, "write to private field"), u ? u.call(f, a) : o.set(f, a), a);
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
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
9
  function E(f) {
10
10
  let o;
11
11
  try {
12
12
  if (o = A && (self.URL || self.webkitURL).createObjectURL(A), !o) throw "";
13
- const a = new Worker(o, {
13
+ const u = new Worker(o, {
14
14
  name: f == null ? void 0 : f.name
15
15
  });
16
- return a.addEventListener("error", () => {
16
+ return u.addEventListener("error", () => {
17
17
  (self.URL || self.webkitURL).revokeObjectURL(o);
18
- }), a;
18
+ }), u;
19
19
  } catch {
20
20
  return new Worker(
21
21
  "data:text/javascript;charset=utf-8," + encodeURIComponent(L),
@@ -35,8 +35,8 @@ class _ {
35
35
  this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
36
36
  });
37
37
  this.worker.onmessage = (o) => {
38
- const { action: a, data: u } = o.data;
39
- a === "onHeader" && this.on.header && this.on.header(u), a === "onTag" && this.on.tag && this.on.tag(u);
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);
40
40
  };
41
41
  }
42
42
  }
@@ -46,12 +46,12 @@ function V(f) {
46
46
  let o;
47
47
  try {
48
48
  if (o = R && (self.URL || self.webkitURL).createObjectURL(R), !o) throw "";
49
- const a = new Worker(o, {
49
+ const u = new Worker(o, {
50
50
  name: f == null ? void 0 : f.name
51
51
  });
52
- return a.addEventListener("error", () => {
52
+ return u.addEventListener("error", () => {
53
53
  (self.URL || self.webkitURL).revokeObjectURL(o);
54
- }), a;
54
+ }), u;
55
55
  } catch {
56
56
  return new Worker(
57
57
  "data:text/javascript;charset=utf-8," + encodeURIComponent(N),
@@ -85,13 +85,13 @@ class j {
85
85
  this.worker.postMessage({ type: "audio", action: "destroy" }), this.worker.postMessage({ type: "video", action: "destroy", data: {} }), this.worker.terminate();
86
86
  });
87
87
  this.worker.onmessage = (o) => {
88
- const { type: a, action: u, data: r } = o.data;
89
- switch (a) {
88
+ const { type: u, action: c, data: r } = o.data;
89
+ switch (u) {
90
90
  case "audio":
91
- u === "onDecode" && this.on.audio.decode && this.on.audio.decode(r), u === "onError" && this.on.audio.error && this.on.audio.error(r);
91
+ c === "onDecode" && this.on.audio.decode && this.on.audio.decode(r), c === "onError" && this.on.audio.error && this.on.audio.error(r);
92
92
  break;
93
93
  case "video":
94
- u === "onDecode" && this.on.video.decode && this.on.video.decode(r), u === "onError" && this.on.video.error && this.on.video.error(r);
94
+ c === "onDecode" && this.on.video.decode && this.on.video.decode(r), c === "onError" && this.on.video.error && this.on.video.error(r);
95
95
  break;
96
96
  }
97
97
  };
@@ -103,12 +103,12 @@ function H(f) {
103
103
  let o;
104
104
  try {
105
105
  if (o = M && (self.URL || self.webkitURL).createObjectURL(M), !o) throw "";
106
- const a = new Worker(o, {
106
+ const u = new Worker(o, {
107
107
  name: f == null ? void 0 : f.name
108
108
  });
109
- return a.addEventListener("error", () => {
109
+ return u.addEventListener("error", () => {
110
110
  (self.URL || self.webkitURL).revokeObjectURL(o);
111
- }), a;
111
+ }), u;
112
112
  } catch {
113
113
  return new Worker(
114
114
  "data:text/javascript;charset=utf-8," + encodeURIComponent(F),
@@ -121,9 +121,9 @@ function H(f) {
121
121
  class $ {
122
122
  constructor() {
123
123
  v(this, "worker", new H());
124
- v(this, "init", ({ offscreenCanvas: o, baseTime: a = 0, writable: u }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, baseTime: a, writable: u } }, [o, u]));
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
125
  v(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
126
- v(this, "setSize", ({ width: o, height: a }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: a } }));
126
+ v(this, "setSize", ({ width: o, height: u }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: u } }));
127
127
  v(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
128
128
  v(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
129
129
  v(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
@@ -132,71 +132,71 @@ class $ {
132
132
  });
133
133
  }
134
134
  }
135
- var q = Object.defineProperty, K = (f, o, a) => o in f ? q(f, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : f[o] = a, h = (f, o, a) => K(f, typeof o != "symbol" ? o + "" : o, a);
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
136
  class Q {
137
- constructor(o, a) {
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", (u) => u), h(this, "stop", () => {
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
139
  {
140
- const u = this.inputStream.getTracks();
141
- for (const r of u)
140
+ const c = this.inputStream.getTracks();
141
+ for (const r of c)
142
142
  r.stop(), this.inputStream.removeTrack(r);
143
143
  }
144
- }), h(this, "getStream", () => this.filterStream(this.outputStream)), h(this, "setMute", (u = !0) => {
145
- u ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
146
- }), h(this, "setInputGain", (u) => {
147
- this.inputGain = u, this.inputGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
148
- }), h(this, "setEnhanceGain", async (u) => {
149
- this.enhanceGain = u + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
150
- }), h(this, "setBgsGain", (u) => {
151
- this.bgsGain = u, this.bgsGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
152
- }), h(this, "setBgmGain", (u) => {
153
- this.bgmGain = u, this.bgmGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
154
- }), h(this, "setOutputGain", (u) => {
155
- this.outputGain = u, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
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
156
  }), h(this, "getVolume", () => {
157
- const { analyserNode: u, analyserArrayData: r } = this;
158
- u.getByteFrequencyData(r);
157
+ const { analyserNode: c, analyserArrayData: r } = this;
158
+ c.getByteFrequencyData(r);
159
159
  let n = 0;
160
160
  for (let i = 0; i < r.length; i++)
161
161
  n += r[i];
162
162
  return Math.ceil(n / r.length);
163
- }), h(this, "mixAudio", (u, r = "bgm") => new Promise(async (n, i) => {
163
+ }), h(this, "mixAudio", (c, r = "bgm") => new Promise(async (n, i) => {
164
164
  try {
165
165
  {
166
166
  const s = this.mixAudioMap.get(r);
167
167
  s && s.stop();
168
168
  }
169
169
  const e = r === "bgs" ? this.bgsGainNode : this.bgmGainNode, t = this.audioContext.createBufferSource();
170
- this.mixAudioMap.set(r, t), t.buffer = u, t.connect(e), t.onended = () => {
170
+ this.mixAudioMap.set(r, t), t.buffer = c, t.connect(e), t.onended = () => {
171
171
  t.disconnect(e), this.mixAudioMap.delete(r), n(!0);
172
172
  }, t.start(0);
173
173
  } catch (e) {
174
174
  i(e);
175
175
  }
176
- })), h(this, "mixAudioStop", (u) => {
177
- const r = this.mixAudioMap.get(u);
176
+ })), h(this, "mixAudioStop", (c) => {
177
+ const r = this.mixAudioMap.get(c);
178
178
  r == null || r.stop();
179
- }), h(this, "changeMix", (u, r) => {
180
- const n = u === "bgs" ? this.bgsGainNode : this.bgmGainNode;
179
+ }), h(this, "changeMix", (c, r) => {
180
+ const n = c === "bgs" ? this.bgsGainNode : this.bgmGainNode;
181
181
  r ? n.connect(this.destinationNode) : n.disconnect(this.destinationNode);
182
- }), 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;
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;
183
183
  {
184
- const { sourceNode: u, inputGainNode: r, enhanceGainNode: n, bgsGainNode: i, bgmGainNode: e, analyserNode: t, outputGainNode: s, destinationNode: l } = this;
185
- u.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);
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);
186
186
  }
187
187
  this.setMute(!0), this.audioContext.resume();
188
188
  }
189
189
  }
190
190
  const J = async (f, o) => {
191
191
  try {
192
- const { format: a, numberOfChannels: u, numberOfFrames: r, sampleRate: n } = o, i = f.createBuffer(u, r, n);
193
- for (let e = 0; e < u; e++) {
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
194
  const t = o.allocationSize({ planeIndex: e }), s = new Uint8Array(t);
195
195
  o.copyTo(s, { planeIndex: e });
196
- const l = new DataView(s.buffer), c = i.getChannelData(e);
196
+ const l = new DataView(s.buffer), a = i.getChannelData(e);
197
197
  for (let d = 0; d < r; d++) {
198
198
  let y;
199
- switch (a) {
199
+ switch (u) {
200
200
  case "s16":
201
201
  // 16-bit signed PCM (范围: -32768 ~ 32767)
202
202
  case "s16-planar":
@@ -213,14 +213,14 @@ const J = async (f, o) => {
213
213
  y = (l.getUint8(d) - 128) / 128;
214
214
  break;
215
215
  default:
216
- throw new Error(`Unsupported audio format: ${a}`);
216
+ throw new Error(`Unsupported audio format: ${u}`);
217
217
  }
218
- c[d] = Math.max(-1, Math.min(1, y));
218
+ a[d] = Math.max(-1, Math.min(1, y));
219
219
  }
220
220
  }
221
221
  return i;
222
- } catch (a) {
223
- throw console.error("Failed to convert AudioData to AudioBuffer:", a), a;
222
+ } catch (u) {
223
+ throw console.error("Failed to convert AudioData to AudioBuffer:", u), u;
224
224
  }
225
225
  };
226
226
  class X {
@@ -242,36 +242,36 @@ class X {
242
242
  async push(o) {
243
243
  try {
244
244
  if (!this.audioContext || !this.destination) return;
245
- const a = await J(this.audioContext, o);
246
- if (!a) return;
247
- const u = this.audioContext.createBufferSource();
248
- u.buffer = a, u.connect(this.destination);
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
249
  const r = Math.max(this.nextStartTime, this.audioContext.currentTime);
250
- this.nextStartTime = r + a.duration, u.start(r), this.pendingSources.push(u), u.onended = () => {
251
- this.pendingSources = this.pendingSources.filter((n) => n !== u);
250
+ this.nextStartTime = r + u.duration, c.start(r), this.pendingSources.push(c), c.onended = () => {
251
+ this.pendingSources = this.pendingSources.filter((n) => n !== c);
252
252
  }, this.audioContext.state === "suspended" && await this.audioContext.resume();
253
253
  } finally {
254
254
  o.close();
255
255
  }
256
256
  }
257
257
  destroy() {
258
- var o, a;
259
- (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 = [];
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 = [];
260
260
  }
261
261
  }
262
262
  var S, T;
263
263
  class Y {
264
264
  constructor(o = {}) {
265
- D(this, S, {
265
+ P(this, S, {
266
266
  timeout: 5 * 1e3
267
267
  });
268
- D(this, T);
268
+ P(this, T);
269
269
  /**
270
270
  *
271
271
  * @param input string | URL | Request
272
272
  * @param init RequestInit
273
273
  */
274
- v(this, "check", (o, a) => new Promise(async (u, r) => {
274
+ v(this, "check", (o, u) => new Promise(async (c, r) => {
275
275
  var i;
276
276
  this.stop(), C(this, T, new AbortController());
277
277
  const n = window.setTimeout(() => {
@@ -279,8 +279,8 @@ class Y {
279
279
  (e = x(this, T)) == null || e.abort("Timeout."), r({ status: "timeout", reason: "" });
280
280
  }, x(this, S).timeout);
281
281
  try {
282
- const e = await fetch(o, { ...a, method: "HEAD", signal: (i = x(this, T)) == null ? void 0 : i.signal });
283
- e.status === 200 ? u({ status: "successed", reason: "" }) : r({ status: "failed", reason: `${e.status}` });
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
284
  } catch (e) {
285
285
  r({ status: "error", reason: e.message });
286
286
  }
@@ -291,12 +291,12 @@ class Y {
291
291
  * @param input string | URL | Request
292
292
  * @param init RequestInit
293
293
  */
294
- v(this, "request", async (o, a) => new Promise(async (u, r) => {
294
+ v(this, "request", async (o, u) => new Promise(async (c, r) => {
295
295
  var n;
296
296
  try {
297
- await this.check(o, a), C(this, T, new AbortController());
298
- const i = await fetch(o, { ...a, signal: (n = x(this, T)) == null ? void 0 : n.signal });
299
- u(i);
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);
300
300
  } catch (i) {
301
301
  this.stop(), r(i);
302
302
  }
@@ -314,13 +314,13 @@ class Y {
314
314
  S = new WeakMap(), T = new WeakMap();
315
315
  const O = (f) => {
316
316
  const o = (f == null ? void 0 : f.getTracks()) || [];
317
- for (const a of o)
318
- a.stop();
317
+ for (const u of o)
318
+ u.stop();
319
319
  }, G = (f) => {
320
- const o = new $(), a = document.createElement("canvas"), u = a.transferControlToOffscreen(), r = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([r]), i = () => {
320
+ const o = new $(), u = document.createElement("canvas"), c = u.transferControlToOffscreen(), r = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([r]), i = () => {
321
321
  o.destroy(), O(n);
322
322
  };
323
- return o.init({ offscreenCanvas: u, baseTime: f, writable: r.writable }), { worker: o, canvas: a, stream: n, destroy: i };
323
+ return o.init({ offscreenCanvas: c, baseTime: f, writable: r.writable }), { worker: o, canvas: u, stream: n, destroy: i };
324
324
  };
325
325
  class be {
326
326
  constructor() {
@@ -347,14 +347,14 @@ class be {
347
347
  * @param url : string
348
348
  */
349
349
  v(this, "start", async (o) => {
350
- var a, u;
350
+ var u, c;
351
351
  try {
352
352
  this.stop(), this.renderBaseTime = (/* @__PURE__ */ new Date()).getTime(), this.init();
353
- const r = (a = (await this.prFetch.request(o)).body) == null ? void 0 : a.getReader();
353
+ const r = (u = (await this.prFetch.request(o)).body) == null ? void 0 : u.getReader();
354
354
  if (!r) throw new Error("Reader is error.");
355
355
  for (; ; ) {
356
356
  const { done: n, value: i } = await r.read();
357
- if (i && ((u = this.demuxerWorker) == null || u.push(i)), n)
357
+ if (i && ((c = this.demuxerWorker) == null || c.push(i)), n)
358
358
  break;
359
359
  }
360
360
  } catch {
@@ -364,8 +364,8 @@ class be {
364
364
  * 停止
365
365
  */
366
366
  v(this, "stop", () => {
367
- var a, u, r, n;
368
- this.prFetch.stop(), (a = this.demuxerWorker) == null || a.destroy(), (u = this.decoderWorker) == null || u.destroy(), (r = this.renderWorker) == null || r.destroy(), O(this.stream);
367
+ var u, c, r, n;
368
+ this.prFetch.stop(), (u = this.demuxerWorker) == null || u.destroy(), (c = this.decoderWorker) == null || c.destroy(), (r = this.renderWorker) == null || r.destroy(), O(this.stream);
369
369
  const o = [...this.cutRenders.keys()];
370
370
  for (const i of o)
371
371
  this.cut.remove(i);
@@ -377,19 +377,19 @@ class be {
377
377
  v(this, "onTag", (o) => {
378
378
  var i;
379
379
  if (!this.decoderWorker) return;
380
- const { header: a, body: u } = o, { tagType: r, timestamp: n } = a;
380
+ const { header: u, body: c } = o, { tagType: r, timestamp: n } = u;
381
381
  switch (r) {
382
382
  case "script":
383
383
  {
384
- const { width: e, height: t } = u;
384
+ const { width: e, height: t } = c;
385
385
  (i = this.renderWorker) == null || i.setSize({ width: e, height: t }), this.on.demuxer.script && this.on.demuxer.script(o);
386
386
  }
387
387
  break;
388
388
  case "audio":
389
389
  {
390
- const { accPacketType: e, data: t } = u;
390
+ const { accPacketType: e, data: t } = c;
391
391
  if (e === 0) {
392
- const { codec: s, sampleRate: l, channelConfiguration: c } = u, d = { codec: s, sampleRate: l, numberOfChannels: c, description: new Uint8Array([]) };
392
+ const { codec: s, sampleRate: l, channelConfiguration: a } = c, d = { codec: s, sampleRate: l, numberOfChannels: a, description: new Uint8Array([]) };
393
393
  this.decoderWorker.audio.init(d);
394
394
  } else e === 1 && this.decoderWorker.audio.decode({ type: "key", timestamp: n * 1, data: t });
395
395
  this.on.demuxer.audio && this.on.demuxer.audio(o);
@@ -397,13 +397,13 @@ class be {
397
397
  break;
398
398
  case "video":
399
399
  {
400
- const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } = u;
400
+ const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } = c;
401
401
  if (e === 0) {
402
- const { codec: c, data: d } = u;
403
- this.decoderWorker.video.init({ codec: c, description: d });
402
+ const { codec: a, data: d } = c;
403
+ this.decoderWorker.video.init({ codec: a, description: d });
404
404
  } else if (e === 1) {
405
- const c = t === 1 ? "key" : "delta";
406
- this.decoderWorker.video.decode({ type: c, timestamp: n * 1e3, data: s });
405
+ const a = t === 1 ? "key" : "delta";
406
+ this.decoderWorker.video.decode({ type: a, timestamp: n * 1e3, data: s });
407
407
  for (const d of l) {
408
408
  const { header: y, payload: p } = d, { nal_unit_type: w } = y;
409
409
  w === 6 && this.on.demuxer.sei && this.on.demuxer.sei(p);
@@ -425,15 +425,15 @@ class be {
425
425
  */
426
426
  v(this, "initDecoder", () => {
427
427
  this.decoderWorker = new j(), this.decoderWorker.on.audio.decode = (o) => {
428
- var a;
429
- (a = this.audioPlayer) == null || a.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
428
+ var u;
429
+ (u = this.audioPlayer) == null || u.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
430
430
  }, this.decoderWorker.on.audio.error = (o) => {
431
431
  this.stop(), this.on.error && this.on.error(o);
432
432
  }, this.decoderWorker.on.video.decode = async (o) => {
433
- var u, r;
434
- (u = this.renderWorker) == null || u.push(o);
435
- const a = [...this.cutRenders.keys()];
436
- for (const n of a)
433
+ var c, r;
434
+ (c = this.renderWorker) == null || c.push(o);
435
+ const u = [...this.cutRenders.keys()];
436
+ for (const n of u)
437
437
  (r = this.cutRenders.get(n)) == null || r.worker.push(o);
438
438
  this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
439
439
  }, this.decoderWorker.on.video.error = (o) => {
@@ -444,63 +444,63 @@ class be {
444
444
  * 初始化渲染器
445
445
  */
446
446
  v(this, "initRender", () => {
447
- const { worker: o, canvas: a, stream: u } = G(this.renderBaseTime);
448
- this.renderWorker = o, this.canvas = a, this.stream = u, this.renderWorker.setPause(!1);
447
+ const { worker: o, canvas: u, stream: c } = G(this.renderBaseTime);
448
+ this.renderWorker = o, this.canvas = u, this.stream = c, this.renderWorker.setPause(!1);
449
449
  });
450
450
  v(this, "getCanvas", () => this.canvas);
451
451
  v(this, "getStream", () => this.stream);
452
452
  v(this, "getCutCanvas", (o) => {
453
- var a;
454
- return (a = this.cutRenders.get(o)) == null ? void 0 : a.canvas;
453
+ var u;
454
+ return (u = this.cutRenders.get(o)) == null ? void 0 : u.canvas;
455
455
  });
456
456
  v(this, "getCutStream", (o) => {
457
- var a;
458
- return (a = this.cutRenders.get(o)) == null ? void 0 : a.stream;
457
+ var u;
458
+ return (u = this.cutRenders.get(o)) == null ? void 0 : u.stream;
459
459
  });
460
460
  v(this, "setPause", (o) => {
461
- var a;
462
- (a = this.renderWorker) == null || a.setPause(o);
461
+ var u;
462
+ (u = this.renderWorker) == null || u.setPause(o);
463
463
  });
464
464
  /**
465
465
  * 设置渲染模式
466
466
  */
467
467
  v(this, "setShader", (o) => {
468
- var a;
469
- (a = this.renderWorker) == null || a.setShader(o);
468
+ var u;
469
+ (u = this.renderWorker) == null || u.setShader(o);
470
470
  });
471
471
  /**
472
472
  * 是否静音 默认为true
473
473
  * @param state?: boolean
474
474
  */
475
475
  v(this, "setMute", (o) => {
476
- var a, u;
477
- return (u = (a = this.audioPlayer) == null ? void 0 : a.prAudioStream) == null ? void 0 : u.setMute(o);
476
+ var u, c;
477
+ return (c = (u = this.audioPlayer) == null ? void 0 : u.prAudioStream) == null ? void 0 : c.setMute(o);
478
478
  });
479
479
  v(this, "cut", {
480
480
  /**
481
481
  * 创建剪切
482
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 = G(this.renderBaseTime), u.worker.setCut(a), this.cutRenders.set(o, u), u);
483
+ create: (o, u) => {
484
+ let c = this.cutRenders.get(o);
485
+ 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);
486
486
  },
487
- setPause: (o, a) => {
488
- var u;
489
- (u = this.cutRenders.get(o)) == null || u.worker.setPause(a);
487
+ setPause: (o, u) => {
488
+ var c;
489
+ (c = this.cutRenders.get(o)) == null || c.worker.setPause(u);
490
490
  },
491
491
  /**
492
492
  * 设置渲染模式
493
493
  */
494
- setShader: (o, a) => {
495
- var u;
496
- (u = this.cutRenders.get(o)) == null || u.worker.setShader(a);
494
+ setShader: (o, u) => {
495
+ var c;
496
+ (c = this.cutRenders.get(o)) == null || c.worker.setShader(u);
497
497
  },
498
498
  /**
499
499
  * 移除剪切
500
500
  */
501
501
  remove: (o) => {
502
- var a;
503
- (a = this.cutRenders.get(o)) == null || a.destroy(), this.cutRenders.delete(o);
502
+ var u;
503
+ (u = this.cutRenders.get(o)) == null || u.destroy(), this.cutRenders.delete(o);
504
504
  }
505
505
  });
506
506
  }
@@ -510,14 +510,14 @@ var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u"
510
510
  function requireAspromise() {
511
511
  if (hasRequiredAspromise) return aspromise;
512
512
  hasRequiredAspromise = 1, aspromise = f;
513
- function f(o, a) {
514
- for (var u = new Array(arguments.length - 1), r = 0, n = 2, i = !0; n < arguments.length; )
515
- u[r++] = arguments[n++];
513
+ function f(o, u) {
514
+ for (var c = new Array(arguments.length - 1), r = 0, n = 2, i = !0; n < arguments.length; )
515
+ c[r++] = arguments[n++];
516
516
  return new Promise(function(t, s) {
517
- u[r] = function(c) {
517
+ c[r] = function(a) {
518
518
  if (i)
519
- if (i = !1, c)
520
- s(c);
519
+ if (i = !1, a)
520
+ s(a);
521
521
  else {
522
522
  for (var d = new Array(arguments.length - 1), y = 0; y < d.length; )
523
523
  d[y++] = arguments[y];
@@ -525,7 +525,7 @@ function requireAspromise() {
525
525
  }
526
526
  };
527
527
  try {
528
- o.apply(a || null, u);
528
+ o.apply(u || null, c);
529
529
  } catch (l) {
530
530
  i && (i = !1, s(l));
531
531
  }
@@ -545,50 +545,50 @@ function requireBase64() {
545
545
  ++s;
546
546
  return Math.ceil(e.length * 3) / 4 - s;
547
547
  };
548
- for (var a = new Array(64), u = new Array(123), r = 0; r < 64; )
549
- u[a[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
548
+ for (var u = new Array(64), c = new Array(123), r = 0; r < 64; )
549
+ c[u[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
550
550
  o.encode = function(e, t, s) {
551
- for (var l = null, c = [], d = 0, y = 0, p; t < s; ) {
551
+ for (var l = null, a = [], d = 0, y = 0, p; t < s; ) {
552
552
  var w = e[t++];
553
553
  switch (y) {
554
554
  case 0:
555
- c[d++] = a[w >> 2], p = (w & 3) << 4, y = 1;
555
+ a[d++] = u[w >> 2], p = (w & 3) << 4, y = 1;
556
556
  break;
557
557
  case 1:
558
- c[d++] = a[p | w >> 4], p = (w & 15) << 2, y = 2;
558
+ a[d++] = u[p | w >> 4], p = (w & 15) << 2, y = 2;
559
559
  break;
560
560
  case 2:
561
- c[d++] = a[p | w >> 6], c[d++] = a[w & 63], y = 0;
561
+ a[d++] = u[p | w >> 6], a[d++] = u[w & 63], y = 0;
562
562
  break;
563
563
  }
564
- d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, c)), d = 0);
564
+ d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, a)), d = 0);
565
565
  }
566
- 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));
566
+ 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));
567
567
  };
568
568
  var n = "invalid encoding";
569
569
  o.decode = function(e, t, s) {
570
- for (var l = s, c = 0, d, y = 0; y < e.length; ) {
570
+ for (var l = s, a = 0, d, y = 0; y < e.length; ) {
571
571
  var p = e.charCodeAt(y++);
572
- if (p === 61 && c > 1)
572
+ if (p === 61 && a > 1)
573
573
  break;
574
- if ((p = u[p]) === void 0)
574
+ if ((p = c[p]) === void 0)
575
575
  throw Error(n);
576
- switch (c) {
576
+ switch (a) {
577
577
  case 0:
578
- d = p, c = 1;
578
+ d = p, a = 1;
579
579
  break;
580
580
  case 1:
581
- t[s++] = d << 2 | (p & 48) >> 4, d = p, c = 2;
581
+ t[s++] = d << 2 | (p & 48) >> 4, d = p, a = 2;
582
582
  break;
583
583
  case 2:
584
- t[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, c = 3;
584
+ t[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, a = 3;
585
585
  break;
586
586
  case 3:
587
- t[s++] = (d & 3) << 6 | p, c = 0;
587
+ t[s++] = (d & 3) << 6 | p, a = 0;
588
588
  break;
589
589
  }
590
590
  }
591
- if (c === 1)
591
+ if (a === 1)
592
592
  throw Error(n);
593
593
  return s - l;
594
594
  }, o.test = function(e) {
@@ -603,27 +603,27 @@ function requireEventemitter() {
603
603
  function f() {
604
604
  this._listeners = {};
605
605
  }
606
- return f.prototype.on = function(a, u, r) {
607
- return (this._listeners[a] || (this._listeners[a] = [])).push({
608
- fn: u,
606
+ return f.prototype.on = function(u, c, r) {
607
+ return (this._listeners[u] || (this._listeners[u] = [])).push({
608
+ fn: c,
609
609
  ctx: r || this
610
610
  }), this;
611
- }, f.prototype.off = function(a, u) {
612
- if (a === void 0)
611
+ }, f.prototype.off = function(u, c) {
612
+ if (u === void 0)
613
613
  this._listeners = {};
614
- else if (u === void 0)
615
- this._listeners[a] = [];
614
+ else if (c === void 0)
615
+ this._listeners[u] = [];
616
616
  else
617
- for (var r = this._listeners[a], n = 0; n < r.length; )
618
- r[n].fn === u ? r.splice(n, 1) : ++n;
617
+ for (var r = this._listeners[u], n = 0; n < r.length; )
618
+ r[n].fn === c ? r.splice(n, 1) : ++n;
619
619
  return this;
620
- }, f.prototype.emit = function(a) {
621
- var u = this._listeners[a];
622
- if (u) {
620
+ }, f.prototype.emit = function(u) {
621
+ var c = this._listeners[u];
622
+ if (c) {
623
623
  for (var r = [], n = 1; n < arguments.length; )
624
624
  r.push(arguments[n++]);
625
- for (n = 0; n < u.length; )
626
- u[n].fn.apply(u[n++].ctx, r);
625
+ for (n = 0; n < c.length; )
626
+ c[n].fn.apply(c[n++].ctx, r);
627
627
  }
628
628
  return this;
629
629
  }, eventemitter;
@@ -642,15 +642,15 @@ function requireFloat() {
642
642
  i[0] = y, p[w] = e[3], p[w + 1] = e[2], p[w + 2] = e[1], p[w + 3] = e[0];
643
643
  }
644
644
  n.writeFloatLE = t ? s : l, n.writeFloatBE = t ? l : s;
645
- function c(y, p) {
645
+ function a(y, p) {
646
646
  return e[0] = y[p], e[1] = y[p + 1], e[2] = y[p + 2], e[3] = y[p + 3], i[0];
647
647
  }
648
648
  function d(y, p) {
649
649
  return e[3] = y[p], e[2] = y[p + 1], e[1] = y[p + 2], e[0] = y[p + 3], i[0];
650
650
  }
651
- n.readFloatLE = t ? c : d, n.readFloatBE = t ? d : c;
651
+ n.readFloatLE = t ? a : d, n.readFloatBE = t ? d : a;
652
652
  }() : function() {
653
- function i(t, s, l, c) {
653
+ function i(t, s, l, a) {
654
654
  var d = s < 0 ? 1 : 0;
655
655
  if (d && (s = -s), s === 0)
656
656
  t(1 / s > 0 ? (
@@ -659,24 +659,24 @@ function requireFloat() {
659
659
  ) : (
660
660
  /* negative 0 */
661
661
  2147483648
662
- ), l, c);
662
+ ), l, a);
663
663
  else if (isNaN(s))
664
- t(2143289344, l, c);
664
+ t(2143289344, l, a);
665
665
  else if (s > 34028234663852886e22)
666
- t((d << 31 | 2139095040) >>> 0, l, c);
666
+ t((d << 31 | 2139095040) >>> 0, l, a);
667
667
  else if (s < 11754943508222875e-54)
668
- t((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, c);
668
+ t((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, a);
669
669
  else {
670
670
  var y = Math.floor(Math.log(s) / Math.LN2), p = Math.round(s * Math.pow(2, -y) * 8388608) & 8388607;
671
- t((d << 31 | y + 127 << 23 | p) >>> 0, l, c);
671
+ t((d << 31 | y + 127 << 23 | p) >>> 0, l, a);
672
672
  }
673
673
  }
674
- n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null, a);
674
+ n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null, u);
675
675
  function e(t, s, l) {
676
- var c = t(s, l), d = (c >> 31) * 2 + 1, y = c >>> 23 & 255, p = c & 8388607;
676
+ var a = t(s, l), d = (a >> 31) * 2 + 1, y = a >>> 23 & 255, p = a & 8388607;
677
677
  return y === 255 ? p ? NaN : d * (1 / 0) : y === 0 ? d * 1401298464324817e-60 * p : d * Math.pow(2, y - 150) * (p + 8388608);
678
678
  }
679
- n.readFloatLE = e.bind(null, u), n.readFloatBE = e.bind(null, r);
679
+ n.readFloatLE = e.bind(null, c), n.readFloatBE = e.bind(null, r);
680
680
  }(), typeof Float64Array < "u" ? function() {
681
681
  var i = new Float64Array([-0]), e = new Uint8Array(i.buffer), t = e[7] === 128;
682
682
  function s(y, p, w) {
@@ -686,53 +686,53 @@ function requireFloat() {
686
686
  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];
687
687
  }
688
688
  n.writeDoubleLE = t ? s : l, n.writeDoubleBE = t ? l : s;
689
- function c(y, p) {
689
+ function a(y, p) {
690
690
  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];
691
691
  }
692
692
  function d(y, p) {
693
693
  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];
694
694
  }
695
- n.readDoubleLE = t ? c : d, n.readDoubleBE = t ? d : c;
695
+ n.readDoubleLE = t ? a : d, n.readDoubleBE = t ? d : a;
696
696
  }() : function() {
697
- function i(t, s, l, c, d, y) {
698
- var p = c < 0 ? 1 : 0;
699
- if (p && (c = -c), c === 0)
700
- t(0, d, y + s), t(1 / c > 0 ? (
697
+ function i(t, s, l, a, d, y) {
698
+ var p = a < 0 ? 1 : 0;
699
+ if (p && (a = -a), a === 0)
700
+ t(0, d, y + s), t(1 / a > 0 ? (
701
701
  /* positive */
702
702
  0
703
703
  ) : (
704
704
  /* negative 0 */
705
705
  2147483648
706
706
  ), d, y + l);
707
- else if (isNaN(c))
707
+ else if (isNaN(a))
708
708
  t(0, d, y + s), t(2146959360, d, y + l);
709
- else if (c > 17976931348623157e292)
709
+ else if (a > 17976931348623157e292)
710
710
  t(0, d, y + s), t((p << 31 | 2146435072) >>> 0, d, y + l);
711
711
  else {
712
712
  var w;
713
- if (c < 22250738585072014e-324)
714
- w = c / 5e-324, t(w >>> 0, d, y + s), t((p << 31 | w / 4294967296) >>> 0, d, y + l);
713
+ if (a < 22250738585072014e-324)
714
+ w = a / 5e-324, t(w >>> 0, d, y + s), t((p << 31 | w / 4294967296) >>> 0, d, y + l);
715
715
  else {
716
- var b = Math.floor(Math.log(c) / Math.LN2);
717
- b === 1024 && (b = 1023), w = c * Math.pow(2, -b), t(w * 4503599627370496 >>> 0, d, y + s), t((p << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, y + l);
716
+ var b = Math.floor(Math.log(a) / Math.LN2);
717
+ 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);
718
718
  }
719
719
  }
720
720
  }
721
- n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null, a, 4, 0);
722
- function e(t, s, l, c, d) {
723
- var y = t(c, d + s), p = t(c, d + l), w = (p >> 31) * 2 + 1, b = p >>> 20 & 2047, m = 4294967296 * (p & 1048575) + y;
721
+ n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null, u, 4, 0);
722
+ function e(t, s, l, a, d) {
723
+ 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;
724
724
  return b === 2047 ? m ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * m : w * Math.pow(2, b - 1075) * (m + 4503599627370496);
725
725
  }
726
- n.readDoubleLE = e.bind(null, u, 0, 4), n.readDoubleBE = e.bind(null, r, 4, 0);
726
+ n.readDoubleLE = e.bind(null, c, 0, 4), n.readDoubleBE = e.bind(null, r, 4, 0);
727
727
  }(), n;
728
728
  }
729
729
  function o(n, i, e) {
730
730
  i[e] = n & 255, i[e + 1] = n >>> 8 & 255, i[e + 2] = n >>> 16 & 255, i[e + 3] = n >>> 24;
731
731
  }
732
- function a(n, i, e) {
732
+ function u(n, i, e) {
733
733
  i[e] = n >>> 24, i[e + 1] = n >>> 16 & 255, i[e + 2] = n >>> 8 & 255, i[e + 3] = n & 255;
734
734
  }
735
- function u(n, i) {
735
+ function c(n, i) {
736
736
  return (n[i] | n[i + 1] << 8 | n[i + 2] << 16 | n[i + 3] << 24) >>> 0;
737
737
  }
738
738
  function r(n, i) {
@@ -759,20 +759,20 @@ var utf8 = {}, hasRequiredUtf8;
759
759
  function requireUtf8() {
760
760
  return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(f) {
761
761
  var o = f;
762
- o.length = function(u) {
763
- for (var r = 0, n = 0, i = 0; i < u.length; ++i)
764
- n = u.charCodeAt(i), n < 128 ? r += 1 : n < 2048 ? r += 2 : (n & 64512) === 55296 && (u.charCodeAt(i + 1) & 64512) === 56320 ? (++i, r += 4) : r += 3;
762
+ o.length = function(c) {
763
+ for (var r = 0, n = 0, i = 0; i < c.length; ++i)
764
+ 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;
765
765
  return r;
766
- }, o.read = function(u, r, n) {
766
+ }, o.read = function(c, r, n) {
767
767
  var i = n - r;
768
768
  if (i < 1)
769
769
  return "";
770
770
  for (var e = null, t = [], s = 0, l; r < n; )
771
- l = u[r++], l < 128 ? t[s++] = l : l > 191 && l < 224 ? t[s++] = (l & 31) << 6 | u[r++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (u[r++] & 63) << 12 | (u[r++] & 63) << 6 | u[r++] & 63) - 65536, t[s++] = 55296 + (l >> 10), t[s++] = 56320 + (l & 1023)) : t[s++] = (l & 15) << 12 | (u[r++] & 63) << 6 | u[r++] & 63, s > 8191 && ((e || (e = [])).push(String.fromCharCode.apply(String, t)), s = 0);
771
+ 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);
772
772
  return e ? (s && e.push(String.fromCharCode.apply(String, t.slice(0, s))), e.join("")) : String.fromCharCode.apply(String, t.slice(0, s));
773
- }, o.write = function(u, r, n) {
774
- for (var i = n, e, t, s = 0; s < u.length; ++s)
775
- e = u.charCodeAt(s), e < 128 ? r[n++] = e : e < 2048 ? (r[n++] = e >> 6 | 192, r[n++] = e & 63 | 128) : (e & 64512) === 55296 && ((t = u.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);
773
+ }, o.write = function(c, r, n) {
774
+ for (var i = n, e, t, s = 0; s < c.length; ++s)
775
+ 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);
776
776
  return n - i;
777
777
  };
778
778
  }(utf8)), utf8;
@@ -781,13 +781,13 @@ var pool_1, hasRequiredPool;
781
781
  function requirePool() {
782
782
  if (hasRequiredPool) return pool_1;
783
783
  hasRequiredPool = 1, pool_1 = f;
784
- function f(o, a, u) {
785
- var r = u || 8192, n = r >>> 1, i = null, e = r;
784
+ function f(o, u, c) {
785
+ var r = c || 8192, n = r >>> 1, i = null, e = r;
786
786
  return function(s) {
787
787
  if (s < 1 || s > n)
788
788
  return o(s);
789
789
  e + s > r && (i = o(r), e = 0);
790
- var l = a.call(i, e, e += s);
790
+ var l = u.call(i, e, e += s);
791
791
  return e & 7 && (e = (e | 7) + 1), l;
792
792
  };
793
793
  }
@@ -801,18 +801,18 @@ function requireLongbits() {
801
801
  function o(n, i) {
802
802
  this.lo = n >>> 0, this.hi = i >>> 0;
803
803
  }
804
- var a = o.zero = new o(0, 0);
805
- a.toNumber = function() {
804
+ var u = o.zero = new o(0, 0);
805
+ u.toNumber = function() {
806
806
  return 0;
807
- }, a.zzEncode = a.zzDecode = function() {
807
+ }, u.zzEncode = u.zzDecode = function() {
808
808
  return this;
809
- }, a.length = function() {
809
+ }, u.length = function() {
810
810
  return 1;
811
811
  };
812
- var u = o.zeroHash = "\0\0\0\0\0\0\0\0";
812
+ var c = o.zeroHash = "\0\0\0\0\0\0\0\0";
813
813
  o.fromNumber = function(i) {
814
814
  if (i === 0)
815
- return a;
815
+ return u;
816
816
  var e = i < 0;
817
817
  e && (i = -i);
818
818
  var t = i >>> 0, s = (i - t) / 4294967296 >>> 0;
@@ -825,7 +825,7 @@ function requireLongbits() {
825
825
  i = f.Long.fromString(i);
826
826
  else
827
827
  return o.fromNumber(parseInt(i, 10));
828
- return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : a;
828
+ return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : u;
829
829
  }, o.prototype.toNumber = function(i) {
830
830
  if (!i && this.hi >>> 31) {
831
831
  var e = ~this.lo + 1 >>> 0, t = ~this.hi >>> 0;
@@ -837,7 +837,7 @@ function requireLongbits() {
837
837
  };
838
838
  var r = String.prototype.charCodeAt;
839
839
  return o.fromHash = function(i) {
840
- return i === u ? a : new o(
840
+ return i === c ? u : new o(
841
841
  (r.call(i, 0) | r.call(i, 1) << 8 | r.call(i, 2) << 16 | r.call(i, 3) << 24) >>> 0,
842
842
  (r.call(i, 4) | r.call(i, 5) << 8 | r.call(i, 6) << 16 | r.call(i, 7) << 24) >>> 0
843
843
  );
@@ -910,21 +910,21 @@ function requireMinimal$1() {
910
910
  var e = o.LongBits.fromHash(n);
911
911
  return o.Long ? o.Long.fromBits(e.lo, e.hi, i) : e.toNumber(!!i);
912
912
  };
913
- function a(r, n, i) {
913
+ function u(r, n, i) {
914
914
  for (var e = Object.keys(n), t = 0; t < e.length; ++t)
915
915
  (r[e[t]] === void 0 || !i) && (r[e[t]] = n[e[t]]);
916
916
  return r;
917
917
  }
918
- o.merge = a, o.lcFirst = function(n) {
918
+ o.merge = u, o.lcFirst = function(n) {
919
919
  return n.charAt(0).toLowerCase() + n.substring(1);
920
920
  };
921
- function u(r) {
921
+ function c(r) {
922
922
  function n(i, e) {
923
923
  if (!(this instanceof n))
924
924
  return new n(i, e);
925
925
  Object.defineProperty(this, "message", { get: function() {
926
926
  return i;
927
- } }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), e && a(this, e);
927
+ } }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), e && u(this, e);
928
928
  }
929
929
  return n.prototype = Object.create(Error.prototype, {
930
930
  constructor: {
@@ -955,7 +955,7 @@ function requireMinimal$1() {
955
955
  }
956
956
  }), n;
957
957
  }
958
- o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(n) {
958
+ o.newError = c, o.ProtocolError = c("ProtocolError"), o.oneOfGetter = function(n) {
959
959
  for (var i = {}, e = 0; e < n.length; ++e)
960
960
  i[n[e]] = 1;
961
961
  return function() {
@@ -993,7 +993,7 @@ var writer, hasRequiredWriter;
993
993
  function requireWriter() {
994
994
  if (hasRequiredWriter) return writer;
995
995
  hasRequiredWriter = 1, writer = t;
996
- var f = requireMinimal$1(), o, a = f.LongBits, u = f.base64, r = f.utf8;
996
+ var f = requireMinimal$1(), o, u = f.LongBits, c = f.base64, r = f.utf8;
997
997
  function n(b, m, g) {
998
998
  this.fn = b, this.len = m, this.next = void 0, this.val = g;
999
999
  }
@@ -1022,7 +1022,7 @@ function requireWriter() {
1022
1022
  function l(b, m, g) {
1023
1023
  m[g] = b & 255;
1024
1024
  }
1025
- function c(b, m, g) {
1025
+ function a(b, m, g) {
1026
1026
  for (; b > 127; )
1027
1027
  m[g++] = b & 127 | 128, b >>>= 7;
1028
1028
  m[g] = b;
@@ -1030,13 +1030,13 @@ function requireWriter() {
1030
1030
  function d(b, m) {
1031
1031
  this.len = b, this.next = void 0, this.val = m;
1032
1032
  }
1033
- d.prototype = Object.create(n.prototype), d.prototype.fn = c, t.prototype.uint32 = function(m) {
1033
+ d.prototype = Object.create(n.prototype), d.prototype.fn = a, t.prototype.uint32 = function(m) {
1034
1034
  return this.len += (this.tail = this.tail.next = new d(
1035
1035
  (m = m >>> 0) < 128 ? 1 : m < 16384 ? 2 : m < 2097152 ? 3 : m < 268435456 ? 4 : 5,
1036
1036
  m
1037
1037
  )).len, this;
1038
1038
  }, t.prototype.int32 = function(m) {
1039
- return m < 0 ? this._push(y, 10, a.fromNumber(m)) : this.uint32(m);
1039
+ return m < 0 ? this._push(y, 10, u.fromNumber(m)) : this.uint32(m);
1040
1040
  }, t.prototype.sint32 = function(m) {
1041
1041
  return this.uint32((m << 1 ^ m >> 31) >>> 0);
1042
1042
  };
@@ -1048,10 +1048,10 @@ function requireWriter() {
1048
1048
  m[g++] = b.lo;
1049
1049
  }
1050
1050
  t.prototype.uint64 = function(m) {
1051
- var g = a.from(m);
1051
+ var g = u.from(m);
1052
1052
  return this._push(y, g.length(), g);
1053
1053
  }, t.prototype.int64 = t.prototype.uint64, t.prototype.sint64 = function(m) {
1054
- var g = a.from(m).zzEncode();
1054
+ var g = u.from(m).zzEncode();
1055
1055
  return this._push(y, g.length(), g);
1056
1056
  }, t.prototype.bool = function(m) {
1057
1057
  return this._push(l, 1, m ? 1 : 0);
@@ -1062,7 +1062,7 @@ function requireWriter() {
1062
1062
  t.prototype.fixed32 = function(m) {
1063
1063
  return this._push(p, 4, m >>> 0);
1064
1064
  }, t.prototype.sfixed32 = t.prototype.fixed32, t.prototype.fixed64 = function(m) {
1065
- var g = a.from(m);
1065
+ var g = u.from(m);
1066
1066
  return this._push(p, 4, g.lo)._push(p, 4, g.hi);
1067
1067
  }, t.prototype.sfixed64 = t.prototype.fixed64, t.prototype.float = function(m) {
1068
1068
  return this._push(f.float.writeFloatLE, 4, m);
@@ -1080,8 +1080,8 @@ function requireWriter() {
1080
1080
  if (!g)
1081
1081
  return this._push(l, 1, 0);
1082
1082
  if (f.isString(m)) {
1083
- var k = t.alloc(g = u.length(m));
1084
- u.decode(m, k, 0), m = k;
1083
+ var k = t.alloc(g = c.length(m));
1084
+ c.decode(m, k, 0), m = k;
1085
1085
  }
1086
1086
  return this.uint32(g)._push(w, g, m);
1087
1087
  }, t.prototype.string = function(m) {
@@ -1105,15 +1105,15 @@ function requireWriter() {
1105
1105
  var writer_buffer, hasRequiredWriter_buffer;
1106
1106
  function requireWriter_buffer() {
1107
1107
  if (hasRequiredWriter_buffer) return writer_buffer;
1108
- hasRequiredWriter_buffer = 1, writer_buffer = a;
1108
+ hasRequiredWriter_buffer = 1, writer_buffer = u;
1109
1109
  var f = requireWriter();
1110
- (a.prototype = Object.create(f.prototype)).constructor = a;
1110
+ (u.prototype = Object.create(f.prototype)).constructor = u;
1111
1111
  var o = requireMinimal$1();
1112
- function a() {
1112
+ function u() {
1113
1113
  f.call(this);
1114
1114
  }
1115
- a._configure = function() {
1116
- a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(n, i, e) {
1115
+ u._configure = function() {
1116
+ u.alloc = o._Buffer_allocUnsafe, u.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(n, i, e) {
1117
1117
  i.set(n, e);
1118
1118
  } : function(n, i, e) {
1119
1119
  if (n.copy)
@@ -1121,29 +1121,29 @@ function requireWriter_buffer() {
1121
1121
  else for (var t = 0; t < n.length; )
1122
1122
  i[e++] = n[t++];
1123
1123
  };
1124
- }, a.prototype.bytes = function(n) {
1124
+ }, u.prototype.bytes = function(n) {
1125
1125
  o.isString(n) && (n = o._Buffer_from(n, "base64"));
1126
1126
  var i = n.length >>> 0;
1127
- return this.uint32(i), i && this._push(a.writeBytesBuffer, i, n), this;
1127
+ return this.uint32(i), i && this._push(u.writeBytesBuffer, i, n), this;
1128
1128
  };
1129
- function u(r, n, i) {
1129
+ function c(r, n, i) {
1130
1130
  r.length < 40 ? o.utf8.write(r, n, i) : n.utf8Write ? n.utf8Write(r, i) : n.write(r, i);
1131
1131
  }
1132
- return a.prototype.string = function(n) {
1132
+ return u.prototype.string = function(n) {
1133
1133
  var i = o.Buffer.byteLength(n);
1134
- return this.uint32(i), i && this._push(u, i, n), this;
1135
- }, a._configure(), writer_buffer;
1134
+ return this.uint32(i), i && this._push(c, i, n), this;
1135
+ }, u._configure(), writer_buffer;
1136
1136
  }
1137
1137
  var reader, hasRequiredReader;
1138
1138
  function requireReader() {
1139
1139
  if (hasRequiredReader) return reader;
1140
1140
  hasRequiredReader = 1, reader = n;
1141
- var f = requireMinimal$1(), o, a = f.LongBits, u = f.utf8;
1142
- function r(c, d) {
1143
- return RangeError("index out of range: " + c.pos + " + " + (d || 1) + " > " + c.len);
1141
+ var f = requireMinimal$1(), o, u = f.LongBits, c = f.utf8;
1142
+ function r(a, d) {
1143
+ return RangeError("index out of range: " + a.pos + " + " + (d || 1) + " > " + a.len);
1144
1144
  }
1145
- function n(c) {
1146
- this.buf = c, this.pos = 0, this.len = c.length;
1145
+ function n(a) {
1146
+ this.buf = a, this.pos = 0, this.len = a.length;
1147
1147
  }
1148
1148
  var i = typeof Uint8Array < "u" ? function(d) {
1149
1149
  if (d instanceof Uint8Array || Array.isArray(d))
@@ -1176,41 +1176,41 @@ function requireReader() {
1176
1176
  return d >>> 1 ^ -(d & 1) | 0;
1177
1177
  };
1178
1178
  function t() {
1179
- var c = new a(0, 0), d = 0;
1179
+ var a = new u(0, 0), d = 0;
1180
1180
  if (this.len - this.pos > 4) {
1181
1181
  for (; d < 4; ++d)
1182
- if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1183
- return c;
1184
- 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)
1185
- return c;
1182
+ if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1183
+ return a;
1184
+ 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)
1185
+ return a;
1186
1186
  d = 0;
1187
1187
  } else {
1188
1188
  for (; d < 3; ++d) {
1189
1189
  if (this.pos >= this.len)
1190
1190
  throw r(this);
1191
- if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1192
- return c;
1191
+ if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
1192
+ return a;
1193
1193
  }
1194
- return c.lo = (c.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, c;
1194
+ return a.lo = (a.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, a;
1195
1195
  }
1196
1196
  if (this.len - this.pos > 4) {
1197
1197
  for (; d < 5; ++d)
1198
- if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1199
- return c;
1198
+ if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1199
+ return a;
1200
1200
  } else
1201
1201
  for (; d < 5; ++d) {
1202
1202
  if (this.pos >= this.len)
1203
1203
  throw r(this);
1204
- if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1205
- return c;
1204
+ if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
1205
+ return a;
1206
1206
  }
1207
1207
  throw Error("invalid varint encoding");
1208
1208
  }
1209
1209
  n.prototype.bool = function() {
1210
1210
  return this.uint32() !== 0;
1211
1211
  };
1212
- function s(c, d) {
1213
- return (c[d - 4] | c[d - 3] << 8 | c[d - 2] << 16 | c[d - 1] << 24) >>> 0;
1212
+ function s(a, d) {
1213
+ return (a[d - 4] | a[d - 3] << 8 | a[d - 2] << 16 | a[d - 1] << 24) >>> 0;
1214
1214
  }
1215
1215
  n.prototype.fixed32 = function() {
1216
1216
  if (this.pos + 4 > this.len)
@@ -1224,7 +1224,7 @@ function requireReader() {
1224
1224
  function l() {
1225
1225
  if (this.pos + 8 > this.len)
1226
1226
  throw r(this, 8);
1227
- return new a(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
1227
+ return new u(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
1228
1228
  }
1229
1229
  return n.prototype.float = function() {
1230
1230
  if (this.pos + 4 > this.len)
@@ -1249,7 +1249,7 @@ function requireReader() {
1249
1249
  return this._slice.call(this.buf, y, p);
1250
1250
  }, n.prototype.string = function() {
1251
1251
  var d = this.bytes();
1252
- return u.read(d, 0, d.length);
1252
+ return c.read(d, 0, d.length);
1253
1253
  }, n.prototype.skip = function(d) {
1254
1254
  if (typeof d == "number") {
1255
1255
  if (this.pos + d > this.len)
@@ -1261,8 +1261,8 @@ function requireReader() {
1261
1261
  throw r(this);
1262
1262
  while (this.buf[this.pos++] & 128);
1263
1263
  return this;
1264
- }, n.prototype.skipType = function(c) {
1265
- switch (c) {
1264
+ }, n.prototype.skipType = function(a) {
1265
+ switch (a) {
1266
1266
  case 0:
1267
1267
  this.skip();
1268
1268
  break;
@@ -1273,19 +1273,19 @@ function requireReader() {
1273
1273
  this.skip(this.uint32());
1274
1274
  break;
1275
1275
  case 3:
1276
- for (; (c = this.uint32() & 7) !== 4; )
1277
- this.skipType(c);
1276
+ for (; (a = this.uint32() & 7) !== 4; )
1277
+ this.skipType(a);
1278
1278
  break;
1279
1279
  case 5:
1280
1280
  this.skip(4);
1281
1281
  break;
1282
1282
  /* istanbul ignore next */
1283
1283
  default:
1284
- throw Error("invalid wire type " + c + " at offset " + this.pos);
1284
+ throw Error("invalid wire type " + a + " at offset " + this.pos);
1285
1285
  }
1286
1286
  return this;
1287
- }, n._configure = function(c) {
1288
- o = c, n.create = e(), o._configure();
1287
+ }, n._configure = function(a) {
1288
+ o = a, n.create = e(), o._configure();
1289
1289
  var d = f.Long ? "toLong" : (
1290
1290
  /* istanbul ignore next */
1291
1291
  "toNumber"
@@ -1312,19 +1312,19 @@ function requireReader() {
1312
1312
  var reader_buffer, hasRequiredReader_buffer;
1313
1313
  function requireReader_buffer() {
1314
1314
  if (hasRequiredReader_buffer) return reader_buffer;
1315
- hasRequiredReader_buffer = 1, reader_buffer = a;
1315
+ hasRequiredReader_buffer = 1, reader_buffer = u;
1316
1316
  var f = requireReader();
1317
- (a.prototype = Object.create(f.prototype)).constructor = a;
1317
+ (u.prototype = Object.create(f.prototype)).constructor = u;
1318
1318
  var o = requireMinimal$1();
1319
- function a(u) {
1320
- f.call(this, u);
1319
+ function u(c) {
1320
+ f.call(this, c);
1321
1321
  }
1322
- return a._configure = function() {
1323
- o.Buffer && (a.prototype._slice = o.Buffer.prototype.slice);
1324
- }, a.prototype.string = function() {
1322
+ return u._configure = function() {
1323
+ o.Buffer && (u.prototype._slice = o.Buffer.prototype.slice);
1324
+ }, u.prototype.string = function() {
1325
1325
  var r = this.uint32();
1326
1326
  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));
1327
- }, a._configure(), reader_buffer;
1327
+ }, u._configure(), reader_buffer;
1328
1328
  }
1329
1329
  var rpc = {}, service, hasRequiredService;
1330
1330
  function requireService() {
@@ -1332,17 +1332,17 @@ function requireService() {
1332
1332
  hasRequiredService = 1, service = o;
1333
1333
  var f = requireMinimal$1();
1334
1334
  (o.prototype = Object.create(f.EventEmitter.prototype)).constructor = o;
1335
- function o(a, u, r) {
1336
- if (typeof a != "function")
1335
+ function o(u, c, r) {
1336
+ if (typeof u != "function")
1337
1337
  throw TypeError("rpcImpl must be a function");
1338
- f.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!r;
1338
+ f.EventEmitter.call(this), this.rpcImpl = u, this.requestDelimited = !!c, this.responseDelimited = !!r;
1339
1339
  }
1340
- return o.prototype.rpcCall = function a(u, r, n, i, e) {
1340
+ return o.prototype.rpcCall = function u(c, r, n, i, e) {
1341
1341
  if (!i)
1342
1342
  throw TypeError("request must be specified");
1343
1343
  var t = this;
1344
1344
  if (!e)
1345
- return f.asPromise(a, t, u, r, n, i);
1345
+ return f.asPromise(u, t, c, r, n, i);
1346
1346
  if (!t.rpcImpl) {
1347
1347
  setTimeout(function() {
1348
1348
  e(Error("already ended"));
@@ -1351,35 +1351,35 @@ function requireService() {
1351
1351
  }
1352
1352
  try {
1353
1353
  return t.rpcImpl(
1354
- u,
1354
+ c,
1355
1355
  r[t.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
1356
- function(l, c) {
1356
+ function(l, a) {
1357
1357
  if (l)
1358
- return t.emit("error", l, u), e(l);
1359
- if (c === null) {
1358
+ return t.emit("error", l, c), e(l);
1359
+ if (a === null) {
1360
1360
  t.end(
1361
1361
  /* endedByRPC */
1362
1362
  !0
1363
1363
  );
1364
1364
  return;
1365
1365
  }
1366
- if (!(c instanceof n))
1366
+ if (!(a instanceof n))
1367
1367
  try {
1368
- c = n[t.responseDelimited ? "decodeDelimited" : "decode"](c);
1368
+ a = n[t.responseDelimited ? "decodeDelimited" : "decode"](a);
1369
1369
  } catch (d) {
1370
- return t.emit("error", d, u), e(d);
1370
+ return t.emit("error", d, c), e(d);
1371
1371
  }
1372
- return t.emit("data", c, u), e(null, c);
1372
+ return t.emit("data", a, c), e(null, a);
1373
1373
  }
1374
1374
  );
1375
1375
  } catch (s) {
1376
- t.emit("error", s, u), setTimeout(function() {
1376
+ t.emit("error", s, c), setTimeout(function() {
1377
1377
  e(s);
1378
1378
  }, 0);
1379
1379
  return;
1380
1380
  }
1381
- }, o.prototype.end = function(u) {
1382
- return this.rpcImpl && (u || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
1381
+ }, o.prototype.end = function(c) {
1382
+ return this.rpcImpl && (c || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
1383
1383
  }, service;
1384
1384
  }
1385
1385
  var hasRequiredRpc;
@@ -1397,11 +1397,11 @@ var hasRequiredIndexMinimal;
1397
1397
  function requireIndexMinimal() {
1398
1398
  return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(f) {
1399
1399
  var o = f;
1400
- 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;
1401
- function a() {
1400
+ 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;
1401
+ function u() {
1402
1402
  o.util._configure(), o.Writer._configure(o.BufferWriter), o.Reader._configure(o.BufferReader);
1403
1403
  }
1404
- a();
1404
+ u();
1405
1405
  }(indexMinimal)), indexMinimal;
1406
1406
  }
1407
1407
  var minimal, hasRequiredMinimal;
@@ -1414,10 +1414,10 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1414
1414
  return f.quick = function() {
1415
1415
  const o = {};
1416
1416
  return o.voice = function() {
1417
- const a = {};
1418
- return a.proto = function() {
1419
- const u = {};
1420
- return u.SeiData = function() {
1417
+ const u = {};
1418
+ return u.proto = function() {
1419
+ const c = {};
1420
+ return c.SeiData = function() {
1421
1421
  function r(n) {
1422
1422
  if (n) for (let i = Object.keys(n), e = 0; e < i.length; ++e) n[i[e]] != null && (this[i[e]] = n[i[e]]);
1423
1423
  }
@@ -1443,9 +1443,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1443
1443
  i instanceof $Reader || (i = $Reader.create(i));
1444
1444
  let s = e === void 0 ? i.len : i.pos + e, l = new $root.com.quick.voice.proto.SeiData();
1445
1445
  for (; i.pos < s; ) {
1446
- let c = i.uint32();
1447
- if (c === t) break;
1448
- switch (c >>> 3) {
1446
+ let a = i.uint32();
1447
+ if (a === t) break;
1448
+ switch (a >>> 3) {
1449
1449
  case 1: {
1450
1450
  l.event = i.int32();
1451
1451
  break;
@@ -1463,7 +1463,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1463
1463
  break;
1464
1464
  }
1465
1465
  default:
1466
- i.skipType(c & 7);
1466
+ i.skipType(a & 7);
1467
1467
  break;
1468
1468
  }
1469
1469
  }
@@ -1510,10 +1510,10 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1510
1510
  }, r.getTypeUrl = function(i) {
1511
1511
  return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
1512
1512
  }, r;
1513
- }(), u.EventType = function() {
1513
+ }(), c.EventType = function() {
1514
1514
  const r = {}, n = Object.create(r);
1515
1515
  return n[r[0] = "Layout"] = 0, n[r[1] = "Custom"] = 1, n;
1516
- }(), u.LayoutData = function() {
1516
+ }(), c.LayoutData = function() {
1517
1517
  function r(i) {
1518
1518
  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]]);
1519
1519
  }
@@ -1551,21 +1551,21 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1551
1551
  return this.encode(e, t).ldelim();
1552
1552
  }, r.decode = function(e, t, s) {
1553
1553
  e instanceof $Reader || (e = $Reader.create(e));
1554
- let l = t === void 0 ? e.len : e.pos + t, c = new $root.com.quick.voice.proto.LayoutData(), d, y;
1554
+ let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.LayoutData(), d, y;
1555
1555
  for (; e.pos < l; ) {
1556
1556
  let p = e.uint32();
1557
1557
  if (p === s) break;
1558
1558
  switch (p >>> 3) {
1559
1559
  case 1: {
1560
- c.roomId = e.string();
1560
+ a.roomId = e.string();
1561
1561
  break;
1562
1562
  }
1563
1563
  case 2: {
1564
- c.type = e.int32();
1564
+ a.type = e.int32();
1565
1565
  break;
1566
1566
  }
1567
1567
  case 3: {
1568
- c.userMap === $util.emptyObject && (c.userMap = {});
1568
+ a.userMap === $util.emptyObject && (a.userMap = {});
1569
1569
  let w = e.uint32() + e.pos;
1570
1570
  for (d = "", y = null; e.pos < w; ) {
1571
1571
  let b = e.uint32();
@@ -1581,11 +1581,11 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1581
1581
  break;
1582
1582
  }
1583
1583
  }
1584
- c.userMap[d] = y;
1584
+ a.userMap[d] = y;
1585
1585
  break;
1586
1586
  }
1587
1587
  case 4: {
1588
- c.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1588
+ a.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1589
1589
  break;
1590
1590
  }
1591
1591
  default:
@@ -1593,7 +1593,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1593
1593
  break;
1594
1594
  }
1595
1595
  }
1596
- return c;
1596
+ return a;
1597
1597
  }, r.decodeDelimited = function(e) {
1598
1598
  return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1599
1599
  }, r.verify = function(e) {
@@ -1664,7 +1664,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1664
1664
  let l;
1665
1665
  if (e.userMap && (l = Object.keys(e.userMap)).length) {
1666
1666
  s.userMap = {};
1667
- for (let c = 0; c < l.length; ++c) s.userMap[l[c]] = $root.com.quick.voice.proto.UserInfo.toObject(e.userMap[l[c]], t);
1667
+ for (let a = 0; a < l.length; ++a) s.userMap[l[a]] = $root.com.quick.voice.proto.UserInfo.toObject(e.userMap[l[a]], t);
1668
1668
  }
1669
1669
  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;
1670
1670
  }, r.prototype.toJSON = function() {
@@ -1672,7 +1672,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1672
1672
  }, r.getTypeUrl = function(e) {
1673
1673
  return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.LayoutData";
1674
1674
  }, r;
1675
- }(), u.UserInfo = function() {
1675
+ }(), c.UserInfo = function() {
1676
1676
  function r(i) {
1677
1677
  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]]);
1678
1678
  }
@@ -1703,25 +1703,25 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1703
1703
  return this.encode(e, t).ldelim();
1704
1704
  }, r.decode = function(e, t, s) {
1705
1705
  e instanceof $Reader || (e = $Reader.create(e));
1706
- let l = t === void 0 ? e.len : e.pos + t, c = new $root.com.quick.voice.proto.UserInfo();
1706
+ let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.UserInfo();
1707
1707
  for (; e.pos < l; ) {
1708
1708
  let d = e.uint32();
1709
1709
  if (d === s) break;
1710
1710
  switch (d >>> 3) {
1711
1711
  case 1: {
1712
- c.id = e.string();
1712
+ a.id = e.string();
1713
1713
  break;
1714
1714
  }
1715
1715
  case 2: {
1716
- c.audios && c.audios.length || (c.audios = []), c.audios.push($root.com.quick.voice.proto.AudioInfo.decode(e, e.uint32()));
1716
+ a.audios && a.audios.length || (a.audios = []), a.audios.push($root.com.quick.voice.proto.AudioInfo.decode(e, e.uint32()));
1717
1717
  break;
1718
1718
  }
1719
1719
  case 3: {
1720
- c.videos && c.videos.length || (c.videos = []), c.videos.push($root.com.quick.voice.proto.VideoInfo.decode(e, e.uint32()));
1720
+ a.videos && a.videos.length || (a.videos = []), a.videos.push($root.com.quick.voice.proto.VideoInfo.decode(e, e.uint32()));
1721
1721
  break;
1722
1722
  }
1723
1723
  case 4: {
1724
- c.custom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1724
+ a.custom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
1725
1725
  break;
1726
1726
  }
1727
1727
  default:
@@ -1729,7 +1729,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1729
1729
  break;
1730
1730
  }
1731
1731
  }
1732
- return c;
1732
+ return a;
1733
1733
  }, r.decodeDelimited = function(e) {
1734
1734
  return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1735
1735
  }, r.verify = function(e) {
@@ -1795,7 +1795,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1795
1795
  }, r.getTypeUrl = function(e) {
1796
1796
  return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.UserInfo";
1797
1797
  }, r;
1798
- }(), u.AudioInfo = function() {
1798
+ }(), c.AudioInfo = function() {
1799
1799
  function r(i) {
1800
1800
  if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
1801
1801
  }
@@ -1827,29 +1827,29 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1827
1827
  return this.encode(e, t).ldelim();
1828
1828
  }, r.decode = function(e, t, s) {
1829
1829
  e instanceof $Reader || (e = $Reader.create(e));
1830
- let l = t === void 0 ? e.len : e.pos + t, c = new $root.com.quick.voice.proto.AudioInfo();
1830
+ let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.AudioInfo();
1831
1831
  for (; e.pos < l; ) {
1832
1832
  let d = e.uint32();
1833
1833
  if (d === s) break;
1834
1834
  switch (d >>> 3) {
1835
1835
  case 1: {
1836
- c.type = e.int32();
1836
+ a.type = e.int32();
1837
1837
  break;
1838
1838
  }
1839
1839
  case 2: {
1840
- c.isEnable = e.bool();
1840
+ a.isEnable = e.bool();
1841
1841
  break;
1842
1842
  }
1843
1843
  case 3: {
1844
- c.isMute = e.bool();
1844
+ a.isMute = e.bool();
1845
1845
  break;
1846
1846
  }
1847
1847
  case 4: {
1848
- c.volume = e.double();
1848
+ a.volume = e.double();
1849
1849
  break;
1850
1850
  }
1851
1851
  case 5: {
1852
- c.updateTime = e.int64();
1852
+ a.updateTime = e.int64();
1853
1853
  break;
1854
1854
  }
1855
1855
  default:
@@ -1857,7 +1857,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1857
1857
  break;
1858
1858
  }
1859
1859
  }
1860
- return c;
1860
+ return a;
1861
1861
  }, r.decodeDelimited = function(e) {
1862
1862
  return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1863
1863
  }, r.verify = function(e) {
@@ -1900,7 +1900,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1900
1900
  }, r.getTypeUrl = function(e) {
1901
1901
  return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.AudioInfo";
1902
1902
  }, r;
1903
- }(), u.VideoInfo = function() {
1903
+ }(), c.VideoInfo = function() {
1904
1904
  function r(i) {
1905
1905
  if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
1906
1906
  }
@@ -1941,41 +1941,41 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1941
1941
  return this.encode(e, t).ldelim();
1942
1942
  }, r.decode = function(e, t, s) {
1943
1943
  e instanceof $Reader || (e = $Reader.create(e));
1944
- let l = t === void 0 ? e.len : e.pos + t, c = new $root.com.quick.voice.proto.VideoInfo();
1944
+ let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.VideoInfo();
1945
1945
  for (; e.pos < l; ) {
1946
1946
  let d = e.uint32();
1947
1947
  if (d === s) break;
1948
1948
  switch (d >>> 3) {
1949
1949
  case 1: {
1950
- c.type = e.int32();
1950
+ a.type = e.int32();
1951
1951
  break;
1952
1952
  }
1953
1953
  case 2: {
1954
- c.isEnable = e.bool();
1954
+ a.isEnable = e.bool();
1955
1955
  break;
1956
1956
  }
1957
1957
  case 3: {
1958
- c.isMute = e.bool();
1958
+ a.isMute = e.bool();
1959
1959
  break;
1960
1960
  }
1961
1961
  case 4: {
1962
- c.width = e.int32();
1962
+ a.width = e.int32();
1963
1963
  break;
1964
1964
  }
1965
1965
  case 5: {
1966
- c.height = e.int32();
1966
+ a.height = e.int32();
1967
1967
  break;
1968
1968
  }
1969
1969
  case 6: {
1970
- c.x = e.int32();
1970
+ a.x = e.int32();
1971
1971
  break;
1972
1972
  }
1973
1973
  case 7: {
1974
- c.y = e.int32();
1974
+ a.y = e.int32();
1975
1975
  break;
1976
1976
  }
1977
1977
  case 8: {
1978
- c.updateTime = e.int64();
1978
+ a.updateTime = e.int64();
1979
1979
  break;
1980
1980
  }
1981
1981
  default:
@@ -1983,7 +1983,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
1983
1983
  break;
1984
1984
  }
1985
1985
  }
1986
- return c;
1986
+ return a;
1987
1987
  }, r.decodeDelimited = function(e) {
1988
1988
  return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
1989
1989
  }, r.verify = function(e) {
@@ -2026,7 +2026,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2026
2026
  }, r.getTypeUrl = function(e) {
2027
2027
  return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.VideoInfo";
2028
2028
  }, r;
2029
- }(), u.CustomInfo = function() {
2029
+ }(), c.CustomInfo = function() {
2030
2030
  function r(i) {
2031
2031
  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]]);
2032
2032
  }
@@ -2059,17 +2059,17 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2059
2059
  return this.encode(e, t).ldelim();
2060
2060
  }, r.decode = function(e, t, s) {
2061
2061
  e instanceof $Reader || (e = $Reader.create(e));
2062
- let l = t === void 0 ? e.len : e.pos + t, c = new $root.com.quick.voice.proto.CustomInfo(), d, y;
2062
+ let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.CustomInfo(), d, y;
2063
2063
  for (; e.pos < l; ) {
2064
2064
  let p = e.uint32();
2065
2065
  if (p === s) break;
2066
2066
  switch (p >>> 3) {
2067
2067
  case 1: {
2068
- c.roomId = e.string();
2068
+ a.roomId = e.string();
2069
2069
  break;
2070
2070
  }
2071
2071
  case 2: {
2072
- c.customKeyMap === $util.emptyObject && (c.customKeyMap = {});
2072
+ a.customKeyMap === $util.emptyObject && (a.customKeyMap = {});
2073
2073
  let w = e.uint32() + e.pos;
2074
2074
  for (d = "", y = ""; e.pos < w; ) {
2075
2075
  let b = e.uint32();
@@ -2085,11 +2085,11 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2085
2085
  break;
2086
2086
  }
2087
2087
  }
2088
- c.customKeyMap[d] = y;
2088
+ a.customKeyMap[d] = y;
2089
2089
  break;
2090
2090
  }
2091
2091
  case 3: {
2092
- c.updateTime = e.int64();
2092
+ a.updateTime = e.int64();
2093
2093
  break;
2094
2094
  }
2095
2095
  default:
@@ -2097,7 +2097,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2097
2097
  break;
2098
2098
  }
2099
2099
  }
2100
- return c;
2100
+ return a;
2101
2101
  }, r.decodeDelimited = function(e) {
2102
2102
  return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
2103
2103
  }, r.verify = function(e) {
@@ -2125,7 +2125,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2125
2125
  let l;
2126
2126
  if (e.customKeyMap && (l = Object.keys(e.customKeyMap)).length) {
2127
2127
  s.customKeyMap = {};
2128
- for (let c = 0; c < l.length; ++c) s.customKeyMap[l[c]] = e.customKeyMap[l[c]];
2128
+ for (let a = 0; a < l.length; ++a) s.customKeyMap[l[a]] = e.customKeyMap[l[a]];
2129
2129
  }
2130
2130
  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;
2131
2131
  }, r.prototype.toJSON = function() {
@@ -2133,17 +2133,17 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
2133
2133
  }, r.getTypeUrl = function(e) {
2134
2134
  return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.CustomInfo";
2135
2135
  }, r;
2136
- }(), u.LayoutType = function() {
2136
+ }(), c.LayoutType = function() {
2137
2137
  const r = {}, n = Object.create(r);
2138
2138
  return n[r[0] = "AudioAndVideo"] = 0, n[r[1] = "OnlyAudio"] = 1, n[r[2] = "OnlyVideo"] = 2, n;
2139
- }(), u.AudioType = function() {
2139
+ }(), c.AudioType = function() {
2140
2140
  const r = {}, n = Object.create(r);
2141
2141
  return n[r[0] = "Microphone"] = 0, n[r[1] = "SystemVoice"] = 1, n;
2142
- }(), u.VideoType = function() {
2142
+ }(), c.VideoType = function() {
2143
2143
  const r = {}, n = Object.create(r);
2144
2144
  return n[r[0] = "Camera"] = 0, n[r[1] = "Screen"] = 1, n;
2145
- }(), u;
2146
- }(), a;
2145
+ }(), c;
2146
+ }(), u;
2147
2147
  }(), o;
2148
2148
  }(), f;
2149
2149
  })(), createAudioInfo = () => ({
@@ -2180,12 +2180,12 @@ class RoomUser {
2180
2180
  });
2181
2181
  v(this, "init", (o) => {
2182
2182
  var e, t, s, l;
2183
- const { id: a, audios: u = [], videos: r = [] } = o;
2184
- this.userId = a;
2183
+ const { id: u, audios: c = [], videos: r = [] } = o;
2184
+ this.userId = u;
2185
2185
  const n = this.getUpdateTimeKey();
2186
2186
  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);
2187
- for (const c of u) {
2188
- const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = c;
2187
+ for (const a of c) {
2188
+ const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = a;
2189
2189
  switch (d) {
2190
2190
  case 0:
2191
2191
  {
@@ -2201,8 +2201,8 @@ class RoomUser {
2201
2201
  break;
2202
2202
  }
2203
2203
  }
2204
- for (const c of r) {
2205
- const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: m, x: g, y: k } = c;
2204
+ for (const a of r) {
2205
+ const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: m, x: g, y: k } = a;
2206
2206
  switch (d) {
2207
2207
  case 0:
2208
2208
  {
@@ -2223,26 +2223,26 @@ class RoomUser {
2223
2223
  n !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
2224
2224
  });
2225
2225
  v(this, "destroy", () => {
2226
- var o, a;
2227
- (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;
2226
+ var o, u;
2227
+ (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;
2228
2228
  });
2229
2229
  }
2230
2230
  }
2231
2231
  const parseSEI = (f) => {
2232
- let o = 0, a = 0;
2232
+ let o = 0, u = 0;
2233
2233
  for (; ; ) {
2234
2234
  const r = f[o];
2235
- if (a = a + r, o = o + 1, r !== 255) break;
2235
+ if (u = u + r, o = o + 1, r !== 255) break;
2236
2236
  }
2237
- let u = 0;
2237
+ let c = 0;
2238
2238
  for (; ; ) {
2239
2239
  const r = f[o];
2240
- if (u = u + r, o = o + 1, r !== 255) break;
2240
+ if (c = c + r, o = o + 1, r !== 255) break;
2241
2241
  }
2242
- if (a === 5) {
2242
+ if (u === 5) {
2243
2243
  const r = f.slice(o, o + 16), i = Array.from(r, (p) => p.toString(16).padStart(2, "0")).join("");
2244
2244
  o = o + 16;
2245
- const e = u - 16, t = f.slice(o, o + e), s = com.quick.voice.proto.SeiData.decode(t), { event: l = 0 } = s, c = s.data;
2245
+ 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;
2246
2246
  let d;
2247
2247
  switch (l) {
2248
2248
  case 0:
@@ -2252,7 +2252,7 @@ const parseSEI = (f) => {
2252
2252
  d = com.quick.voice.proto.CustomInfo.decode(s.data);
2253
2253
  break;
2254
2254
  }
2255
- return { uuid: i, ...s, event: l, data_remote: c, data: d };
2255
+ return { uuid: i, ...s, event: l, data_remote: a, data: d };
2256
2256
  }
2257
2257
  };
2258
2258
  class QuickVoPlayer {
@@ -2275,10 +2275,10 @@ class QuickVoPlayer {
2275
2275
  this.prPlayer.init();
2276
2276
  });
2277
2277
  v(this, "start", (o) => {
2278
- this.prPlayer.start(o);
2278
+ this.stop(), this.prPlayer.start(o);
2279
2279
  });
2280
2280
  v(this, "stop", () => {
2281
- this.prPlayer.stop();
2281
+ this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
2282
2282
  });
2283
2283
  v(this, "setMute", (o) => {
2284
2284
  this.prPlayer.setMute(o);
@@ -2286,26 +2286,35 @@ class QuickVoPlayer {
2286
2286
  v(this, "getStream", () => this.prPlayer.getStream());
2287
2287
  v(this, "getAllUseUpdateKey", () => {
2288
2288
  const o = [...this.usersMap.values()];
2289
- return Array.from(o, (u) => u.updateTime).join("_");
2289
+ return Array.from(o, (c) => c.updateTime).join("_");
2290
2290
  });
2291
- v(this, "checkAndCreateUser", (o, a) => {
2292
- if (!this.usersMap.has(o)) {
2293
- const r = new RoomUser();
2294
- this.usersMap.set(o, r);
2295
- }
2296
- const u = this.usersMap.get(o);
2297
- if (u) {
2298
- if (u.init(a), u.mc_video) {
2299
- const { sx: r, sy: n, sw: i, sh: e } = u.mc_video, t = `${u.userId}_mc_video`, { stream: s, destroy: l } = this.prPlayer.cut.create(t, { sx: r, sy: n, sw: i, sh: e });
2300
- u.mc_video.stream = s, u.mc_video.destroy = () => {
2301
- l(), this.prPlayer.cut.remove(t), this.usersMap.delete(u.userId);
2302
- };
2291
+ v(this, "checkAndCreateUser", (o, u) => {
2292
+ var c, r;
2293
+ if (this.usersMap.has(o)) {
2294
+ const n = this.usersMap.get(o);
2295
+ if (n == null || n.init(u), n != null && n.mc_video) {
2296
+ const { sx: i, sy: e, sw: t, sh: s } = n.mc_video;
2297
+ (c = n == null ? void 0 : n.mc_video.worker) == null || c.setCut({ sx: i, sy: e, sw: t, sh: s });
2298
+ }
2299
+ if (n != null && n.ss_video) {
2300
+ const { sx: i, sy: e, sw: t, sh: s } = n.ss_video;
2301
+ (r = n == null ? void 0 : n.ss_video.worker) == null || r.setCut({ sx: i, sy: e, sw: t, sh: s });
2303
2302
  }
2304
- if (u.ss_video) {
2305
- const { sx: r, sy: n, sw: i, sh: e } = u.ss_video, t = `${u.userId}_ss_video`, { stream: s, destroy: l } = this.prPlayer.cut.create(t, { sx: r, sy: n, sw: i, sh: e });
2306
- u.ss_video.stream = s, u.ss_video.destroy = () => {
2307
- l(), this.prPlayer.cut.remove(t), this.usersMap.delete(u.userId);
2308
- };
2303
+ } else {
2304
+ const n = new RoomUser();
2305
+ if (this.usersMap.set(o, n), n.init(u), n) {
2306
+ if (n.mc_video) {
2307
+ 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 });
2308
+ n.mc_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.mc_video.stream = d, n.mc_video.destroy = () => {
2309
+ y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
2310
+ };
2311
+ }
2312
+ if (n.ss_video) {
2313
+ 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 });
2314
+ n.ss_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.ss_video.stream = d, n.ss_video.destroy = () => {
2315
+ y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
2316
+ };
2317
+ }
2309
2318
  }
2310
2319
  }
2311
2320
  });
@@ -2314,10 +2323,10 @@ class QuickVoPlayer {
2314
2323
  */
2315
2324
  v(this, "onSEI", (o) => {
2316
2325
  try {
2317
- const a = parseSEI(o);
2318
- if (!a) return;
2319
- const { event: u, data: r } = a;
2320
- switch (u) {
2326
+ const u = parseSEI(o);
2327
+ if (!u) return;
2328
+ const { event: c, data: r } = u;
2329
+ switch (c) {
2321
2330
  case 0:
2322
2331
  {
2323
2332
  const { roomId: n, userMap: i } = r;
@@ -2325,17 +2334,17 @@ class QuickVoPlayer {
2325
2334
  const e = this.getAllUseUpdateKey(), t = Object.keys(i);
2326
2335
  {
2327
2336
  const l = [...this.usersMap.values()];
2328
- for (const c of l)
2329
- t.includes(c.userId) || c == null || c.destroy();
2337
+ for (const a of l)
2338
+ t.includes(a.userId) || a == null || a.destroy();
2330
2339
  }
2331
2340
  for (const l of t) {
2332
- const c = i[l];
2333
- this.checkAndCreateUser(l, c);
2341
+ const a = i[l];
2342
+ this.checkAndCreateUser(l, a);
2334
2343
  }
2335
2344
  const s = this.getAllUseUpdateKey();
2336
2345
  if (e !== s && this.on.users) {
2337
- const l = [...this.usersMap.values()], c = 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 }));
2338
- this.on.users(c);
2346
+ 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 }));
2347
+ this.on.users(a);
2339
2348
  }
2340
2349
  }
2341
2350
  break;
@@ -2346,8 +2355,29 @@ class QuickVoPlayer {
2346
2355
  }
2347
2356
  break;
2348
2357
  }
2349
- } catch (a) {
2350
- console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", a);
2358
+ } catch (u) {
2359
+ console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", u);
2360
+ }
2361
+ });
2362
+ v(this, "setDisplayMode", (o) => {
2363
+ var u, c, r, n, i, e, t, s;
2364
+ switch (this.displayMode = o, o) {
2365
+ case "original":
2366
+ {
2367
+ this.prPlayer.setPause(!1);
2368
+ const l = [...this.usersMap.values()];
2369
+ for (const a of l)
2370
+ (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);
2371
+ }
2372
+ break;
2373
+ case "cut":
2374
+ {
2375
+ this.prPlayer.setPause(!0);
2376
+ const l = [...this.usersMap.values()];
2377
+ for (const a of l)
2378
+ (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);
2379
+ }
2380
+ break;
2351
2381
  }
2352
2382
  });
2353
2383
  this.prPlayer.on.demuxer.sei = this.onSEI;