@seayoo-web/app-info 0.1.0 → 0.2.1

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,298 +1,318 @@
1
- import { loadAsync as J } from "jszip";
2
- function Q(g) {
3
- return typeof g == "string" ? g : `${g}`;
1
+ import rt from "jszip";
2
+ function Q(f) {
3
+ return typeof f == "string" ? f : `${f}`;
4
4
  }
5
- function at(g) {
6
- return typeof g == "number" ? g : typeof g == "string" ? /^\d+(?:\.\d+)/.test(g) ? +g : Number(g) : NaN;
5
+ function ct(f) {
6
+ return typeof f == "number" ? f : typeof f == "string" ? /^\d+(?:\.\d+)/.test(f) ? +f : Number(f) : NaN;
7
7
  }
8
- function B(g) {
9
- return g instanceof Error ? g : new Error(String(g));
8
+ function P(f) {
9
+ return f instanceof Error ? f : new Error(String(f));
10
10
  }
11
- function rt(g) {
12
- return `data:image/png;base64,${g}`;
11
+ function it(f) {
12
+ return `data:image/png;base64,${f}`;
13
13
  }
14
- async function Mt(g, i) {
15
- const n = await J(g).catch(B);
16
- if (n instanceof Error)
17
- return new Error(`load file error: ${n.message}`);
18
- const a = await ot(n);
19
- if (a instanceof Error)
20
- return new Error(`read pack.info error: ${a.message}`);
21
- const c = {
22
- package: a.summary.app.bundleName,
23
- versionCode: a.summary.app.version.code,
24
- versionName: a.summary.app.version.name,
25
- summary: a.summary,
26
- packages: a.packages
27
- };
28
- if (i?.ignoreIcon)
29
- return c;
30
- const E = a.packages.find((m) => m.moduleType === "entry");
31
- if (!E)
32
- return c;
33
- const w = n.file(`${E.name}.hap`);
34
- if (!w)
35
- return c;
36
- const y = await w.async("arraybuffer").catch(B);
37
- if (y instanceof Error)
38
- return c;
39
- const I = await J(y).catch(B);
40
- if (I instanceof Error)
41
- return c;
42
- const N = await ht(I);
43
- if (N instanceof Error)
44
- return c;
45
- const T = await ut(I, N.app.icon);
46
- return T instanceof Error || (c.icon = rt(T)), c;
14
+ async function nt(f, i, n) {
15
+ const s = f.file(i) || f.filter((w) => w.includes(i))[0];
16
+ if (!s)
17
+ return new Error(`not found ${i}`);
18
+ const c = await s.async(n).catch(P);
19
+ return c instanceof Error ? new Error(`read ${i} error: ${c.message}`) : { name: s.name, content: c };
20
+ }
21
+ const st = rt.loadAsync;
22
+ class Gt {
23
+ zip;
24
+ constructor(i) {
25
+ this.zip = st(i).catch(P);
26
+ }
27
+ async parse(i) {
28
+ const n = await this.zip;
29
+ if (n instanceof Error)
30
+ return new Error(`load file error: ${n.message}`);
31
+ const s = await ft(n);
32
+ if (s instanceof Error)
33
+ return new Error(`read pack.info error: ${s.message}`);
34
+ const c = {
35
+ package: s.summary.app.bundleName,
36
+ versionCode: s.summary.app.version.code,
37
+ versionName: s.summary.app.version.name,
38
+ pack: s
39
+ };
40
+ if (i?.ignoreIcon)
41
+ return c;
42
+ const w = s.packages.find((v) => v.moduleType === "entry");
43
+ if (!w)
44
+ return c;
45
+ const d = n.file(`${w.name}.hap`);
46
+ if (!d)
47
+ return c;
48
+ const E = await d.async("arraybuffer").catch(P);
49
+ if (E instanceof Error)
50
+ return c;
51
+ const T = await st(E).catch(P);
52
+ if (T instanceof Error)
53
+ return c;
54
+ const U = await gt(T);
55
+ if (U instanceof Error)
56
+ return c;
57
+ const I = await pt(T, U.app.icon);
58
+ return I instanceof Error || (c.icon = it(I)), c;
59
+ }
60
+ /**
61
+ * 读取指定文件的内容
62
+ */
63
+ async readFile(i, n) {
64
+ const s = await this.zip;
65
+ return s instanceof Error ? new Error(`load file error: ${s.message}`) : await nt(s, i, n);
66
+ }
47
67
  }
48
- async function ot(g) {
49
- const i = g.file("pack.info");
68
+ async function ft(f) {
69
+ const i = f.file("pack.info");
50
70
  if (!i)
51
71
  return new Error("not found pack.info file");
52
- const n = await i.async("text").catch(B);
72
+ const n = await i.async("text").catch(P);
53
73
  if (n instanceof Error)
54
74
  return new Error(`read pack.info file error: ${n.message}`);
55
75
  if (!n)
56
76
  return new Error("pack.info file is empty");
57
77
  try {
58
78
  return JSON.parse(n);
59
- } catch (a) {
60
- const c = B(a);
79
+ } catch (s) {
80
+ const c = P(s);
61
81
  return new Error(`parse pack.info file error: ${c.message}`);
62
82
  }
63
83
  }
64
- async function ht(g) {
65
- const i = g.file("module.json") || g.file("module.json5");
84
+ async function gt(f) {
85
+ const i = f.file("module.json") || f.file("module.json5");
66
86
  if (!i)
67
87
  return new Error("not found module.json file");
68
- const n = await i.async("text").catch(B);
88
+ const n = await i.async("text").catch(P);
69
89
  if (n instanceof Error)
70
90
  return new Error(`read module.json file error: ${n.message}`);
71
91
  if (!n)
72
92
  return new Error("module.json file is empty");
73
93
  try {
74
94
  return JSON.parse(n);
75
- } catch (a) {
76
- const c = B(a);
95
+ } catch (s) {
96
+ const c = P(s);
77
97
  return new Error(`parse module.json file error: ${c.message}`);
78
98
  }
79
99
  }
80
- async function ut(g, i) {
81
- const a = `resources/base/media/${(i || "app_icon").replace(/(?:^\$media:|\.[a-z]+$)/gi, "")}.png`, c = g.file(a);
100
+ async function pt(f, i) {
101
+ const s = `resources/base/media/${(i || "app_icon").replace(/(?:^\$media:|\.[a-z]+$)/gi, "")}.png`, c = f.file(s);
82
102
  if (!c)
83
- return new Error(`not found icon file at ${a}`);
84
- const E = await c.async("base64").catch(B);
85
- return E instanceof Error ? new Error(`read icon file error: ${E.message}`) : E;
103
+ return new Error(`not found icon file at ${s}`);
104
+ const w = await c.async("base64").catch(P);
105
+ return w instanceof Error ? new Error(`read icon file error: ${w.message}`) : w;
86
106
  }
87
- function lt(g) {
88
- return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g;
107
+ function dt(f) {
108
+ return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
89
109
  }
90
- function st(g) {
91
- throw new Error('Could not dynamically require "' + g + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
110
+ function ut(f) {
111
+ throw new Error('Could not dynamically require "' + f + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
92
112
  }
93
- var W = { exports: {} }, K = { exports: {} }, ct = K.exports, it;
94
- function ft() {
95
- return it || (it = 1, function(g) {
113
+ var K = { exports: {} }, J = { exports: {} }, yt = J.exports, at;
114
+ function wt() {
115
+ return at || (at = 1, function(f) {
96
116
  /**
97
117
  * @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
98
118
  * Released under the Apache License, Version 2.0
99
119
  * see: https://github.com/dcodeIO/long.js for details
100
120
  */
101
121
  (function(i, n) {
102
- typeof st == "function" && g && g.exports ? g.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n();
103
- })(ct, function() {
104
- function i(f, h, b) {
105
- this.low = f | 0, this.high = h | 0, this.unsigned = !!b;
122
+ typeof ut == "function" && f && f.exports ? f.exports = n() : (i.dcodeIO = i.dcodeIO || {}).Long = n();
123
+ })(yt, function() {
124
+ function i(g, h, b) {
125
+ this.low = g | 0, this.high = h | 0, this.unsigned = !!b;
106
126
  }
107
127
  i.prototype.__isLong__, Object.defineProperty(i.prototype, "__isLong__", {
108
128
  value: !0,
109
129
  enumerable: !1,
110
130
  configurable: !1
111
131
  });
112
- function n(f) {
113
- return (f && f.__isLong__) === !0;
132
+ function n(g) {
133
+ return (g && g.__isLong__) === !0;
114
134
  }
115
135
  i.isLong = n;
116
- var a = {}, c = {};
117
- function E(f, h) {
118
- var b, v, x;
119
- return h ? (f >>>= 0, (x = 0 <= f && f < 256) && (v = c[f], v) ? v : (b = y(f, (f | 0) < 0 ? -1 : 0, !0), x && (c[f] = b), b)) : (f |= 0, (x = -128 <= f && f < 128) && (v = a[f], v) ? v : (b = y(f, f < 0 ? -1 : 0, !1), x && (a[f] = b), b));
136
+ var s = {}, c = {};
137
+ function w(g, h) {
138
+ var b, m, x;
139
+ return h ? (g >>>= 0, (x = 0 <= g && g < 256) && (m = c[g], m) ? m : (b = E(g, (g | 0) < 0 ? -1 : 0, !0), x && (c[g] = b), b)) : (g |= 0, (x = -128 <= g && g < 128) && (m = s[g], m) ? m : (b = E(g, g < 0 ? -1 : 0, !1), x && (s[g] = b), b));
120
140
  }
121
- i.fromInt = E;
122
- function w(f, h) {
123
- if (isNaN(f) || !isFinite(f))
141
+ i.fromInt = w;
142
+ function d(g, h) {
143
+ if (isNaN(g) || !isFinite(g))
124
144
  return h ? l : u;
125
145
  if (h) {
126
- if (f < 0)
146
+ if (g < 0)
127
147
  return l;
128
- if (f >= r)
129
- return L;
130
- } else {
131
- if (f <= -s)
148
+ if (g >= r)
132
149
  return _;
133
- if (f + 1 >= s)
134
- return A;
150
+ } else {
151
+ if (g <= -a)
152
+ return L;
153
+ if (g + 1 >= a)
154
+ return N;
135
155
  }
136
- return f < 0 ? w(-f, h).neg() : y(f % e | 0, f / e | 0, h);
156
+ return g < 0 ? d(-g, h).neg() : E(g % e | 0, g / e | 0, h);
137
157
  }
138
- i.fromNumber = w;
139
- function y(f, h, b) {
140
- return new i(f, h, b);
158
+ i.fromNumber = d;
159
+ function E(g, h, b) {
160
+ return new i(g, h, b);
141
161
  }
142
- i.fromBits = y;
143
- var I = Math.pow;
144
- function N(f, h, b) {
145
- if (f.length === 0)
162
+ i.fromBits = E;
163
+ var T = Math.pow;
164
+ function U(g, h, b) {
165
+ if (g.length === 0)
146
166
  throw Error("empty string");
147
- if (f === "NaN" || f === "Infinity" || f === "+Infinity" || f === "-Infinity")
167
+ if (g === "NaN" || g === "Infinity" || g === "+Infinity" || g === "-Infinity")
148
168
  return u;
149
169
  if (typeof h == "number" ? (b = h, h = !1) : h = !!h, b = b || 10, b < 2 || 36 < b)
150
170
  throw RangeError("radix");
151
- var v;
152
- if ((v = f.indexOf("-")) > 0)
171
+ var m;
172
+ if ((m = g.indexOf("-")) > 0)
153
173
  throw Error("interior hyphen");
154
- if (v === 0)
155
- return N(f.substring(1), h, b).neg();
156
- for (var x = w(I(b, 8)), U = u, k = 0; k < f.length; k += 8) {
157
- var O = Math.min(8, f.length - k), R = parseInt(f.substring(k, k + O), b);
174
+ if (m === 0)
175
+ return U(g.substring(1), h, b).neg();
176
+ for (var x = d(T(b, 8)), A = u, k = 0; k < g.length; k += 8) {
177
+ var O = Math.min(8, g.length - k), C = parseInt(g.substring(k, k + O), b);
158
178
  if (O < 8) {
159
- var D = w(I(b, O));
160
- U = U.mul(D).add(w(R));
179
+ var D = d(T(b, O));
180
+ A = A.mul(D).add(d(C));
161
181
  } else
162
- U = U.mul(x), U = U.add(w(R));
182
+ A = A.mul(x), A = A.add(d(C));
163
183
  }
164
- return U.unsigned = h, U;
184
+ return A.unsigned = h, A;
165
185
  }
166
- i.fromString = N;
167
- function T(f) {
168
- return f instanceof i ? f : typeof f == "number" ? w(f) : typeof f == "string" ? N(f) : y(f.low, f.high, f.unsigned);
186
+ i.fromString = U;
187
+ function I(g) {
188
+ return g instanceof i ? g : typeof g == "number" ? d(g) : typeof g == "string" ? U(g) : E(g.low, g.high, g.unsigned);
169
189
  }
170
- i.fromValue = T;
171
- var m = 65536, t = 1 << 24, e = m * m, r = e * e, s = r / 2, o = E(t), u = E(0);
190
+ i.fromValue = I;
191
+ var v = 65536, t = 1 << 24, e = v * v, r = e * e, a = r / 2, o = w(t), u = w(0);
172
192
  i.ZERO = u;
173
- var l = E(0, !0);
193
+ var l = w(0, !0);
174
194
  i.UZERO = l;
175
- var p = E(1);
195
+ var p = w(1);
176
196
  i.ONE = p;
177
- var F = E(1, !0);
197
+ var F = w(1, !0);
178
198
  i.UONE = F;
179
- var S = E(-1);
199
+ var S = w(-1);
180
200
  i.NEG_ONE = S;
181
- var A = y(-1, 2147483647, !1);
182
- i.MAX_VALUE = A;
183
- var L = y(-1, -1, !0);
184
- i.MAX_UNSIGNED_VALUE = L;
185
- var _ = y(0, -2147483648, !1);
186
- i.MIN_VALUE = _;
187
- var d = i.prototype;
188
- return d.toInt = function() {
201
+ var N = E(-1, 2147483647, !1);
202
+ i.MAX_VALUE = N;
203
+ var _ = E(-1, -1, !0);
204
+ i.MAX_UNSIGNED_VALUE = _;
205
+ var L = E(0, -2147483648, !1);
206
+ i.MIN_VALUE = L;
207
+ var y = i.prototype;
208
+ return y.toInt = function() {
189
209
  return this.unsigned ? this.low >>> 0 : this.low;
190
- }, d.toNumber = function() {
210
+ }, y.toNumber = function() {
191
211
  return this.unsigned ? (this.high >>> 0) * e + (this.low >>> 0) : this.high * e + (this.low >>> 0);
192
- }, d.toString = function(h) {
212
+ }, y.toString = function(h) {
193
213
  if (h = h || 10, h < 2 || 36 < h)
194
214
  throw RangeError("radix");
195
215
  if (this.isZero())
196
216
  return "0";
197
217
  if (this.isNegative())
198
- if (this.eq(_)) {
199
- var b = w(h), v = this.div(b), x = v.mul(b).sub(this);
200
- return v.toString(h) + x.toInt().toString(h);
218
+ if (this.eq(L)) {
219
+ var b = d(h), m = this.div(b), x = m.mul(b).sub(this);
220
+ return m.toString(h) + x.toInt().toString(h);
201
221
  } else
202
222
  return "-" + this.neg().toString(h);
203
- for (var U = w(I(h, 6), this.unsigned), k = this, O = ""; ; ) {
204
- var R = k.div(U), D = k.sub(R.mul(U)).toInt() >>> 0, M = D.toString(h);
205
- if (k = R, k.isZero())
223
+ for (var A = d(T(h, 6), this.unsigned), k = this, O = ""; ; ) {
224
+ var C = k.div(A), D = k.sub(C.mul(A)).toInt() >>> 0, M = D.toString(h);
225
+ if (k = C, k.isZero())
206
226
  return M + O;
207
227
  for (; M.length < 6; )
208
228
  M = "0" + M;
209
229
  O = "" + M + O;
210
230
  }
211
- }, d.getHighBits = function() {
231
+ }, y.getHighBits = function() {
212
232
  return this.high;
213
- }, d.getHighBitsUnsigned = function() {
233
+ }, y.getHighBitsUnsigned = function() {
214
234
  return this.high >>> 0;
215
- }, d.getLowBits = function() {
235
+ }, y.getLowBits = function() {
216
236
  return this.low;
217
- }, d.getLowBitsUnsigned = function() {
237
+ }, y.getLowBitsUnsigned = function() {
218
238
  return this.low >>> 0;
219
- }, d.getNumBitsAbs = function() {
239
+ }, y.getNumBitsAbs = function() {
220
240
  if (this.isNegative())
221
- return this.eq(_) ? 64 : this.neg().getNumBitsAbs();
241
+ return this.eq(L) ? 64 : this.neg().getNumBitsAbs();
222
242
  for (var h = this.high != 0 ? this.high : this.low, b = 31; b > 0 && (h & 1 << b) == 0; b--)
223
243
  ;
224
244
  return this.high != 0 ? b + 33 : b + 1;
225
- }, d.isZero = function() {
245
+ }, y.isZero = function() {
226
246
  return this.high === 0 && this.low === 0;
227
- }, d.isNegative = function() {
247
+ }, y.isNegative = function() {
228
248
  return !this.unsigned && this.high < 0;
229
- }, d.isPositive = function() {
249
+ }, y.isPositive = function() {
230
250
  return this.unsigned || this.high >= 0;
231
- }, d.isOdd = function() {
251
+ }, y.isOdd = function() {
232
252
  return (this.low & 1) === 1;
233
- }, d.isEven = function() {
253
+ }, y.isEven = function() {
234
254
  return (this.low & 1) === 0;
235
- }, d.equals = function(h) {
236
- return n(h) || (h = T(h)), this.unsigned !== h.unsigned && this.high >>> 31 === 1 && h.high >>> 31 === 1 ? !1 : this.high === h.high && this.low === h.low;
237
- }, d.eq = d.equals, d.notEquals = function(h) {
255
+ }, y.equals = function(h) {
256
+ return n(h) || (h = I(h)), this.unsigned !== h.unsigned && this.high >>> 31 === 1 && h.high >>> 31 === 1 ? !1 : this.high === h.high && this.low === h.low;
257
+ }, y.eq = y.equals, y.notEquals = function(h) {
238
258
  return !this.eq(
239
259
  /* validates */
240
260
  h
241
261
  );
242
- }, d.neq = d.notEquals, d.lessThan = function(h) {
262
+ }, y.neq = y.notEquals, y.lessThan = function(h) {
243
263
  return this.comp(
244
264
  /* validates */
245
265
  h
246
266
  ) < 0;
247
- }, d.lt = d.lessThan, d.lessThanOrEqual = function(h) {
267
+ }, y.lt = y.lessThan, y.lessThanOrEqual = function(h) {
248
268
  return this.comp(
249
269
  /* validates */
250
270
  h
251
271
  ) <= 0;
252
- }, d.lte = d.lessThanOrEqual, d.greaterThan = function(h) {
272
+ }, y.lte = y.lessThanOrEqual, y.greaterThan = function(h) {
253
273
  return this.comp(
254
274
  /* validates */
255
275
  h
256
276
  ) > 0;
257
- }, d.gt = d.greaterThan, d.greaterThanOrEqual = function(h) {
277
+ }, y.gt = y.greaterThan, y.greaterThanOrEqual = function(h) {
258
278
  return this.comp(
259
279
  /* validates */
260
280
  h
261
281
  ) >= 0;
262
- }, d.gte = d.greaterThanOrEqual, d.compare = function(h) {
263
- if (n(h) || (h = T(h)), this.eq(h))
282
+ }, y.gte = y.greaterThanOrEqual, y.compare = function(h) {
283
+ if (n(h) || (h = I(h)), this.eq(h))
264
284
  return 0;
265
- var b = this.isNegative(), v = h.isNegative();
266
- return b && !v ? -1 : !b && v ? 1 : this.unsigned ? h.high >>> 0 > this.high >>> 0 || h.high === this.high && h.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(h).isNegative() ? -1 : 1;
267
- }, d.comp = d.compare, d.negate = function() {
268
- return !this.unsigned && this.eq(_) ? _ : this.not().add(p);
269
- }, d.neg = d.negate, d.add = function(h) {
270
- n(h) || (h = T(h));
271
- var b = this.high >>> 16, v = this.high & 65535, x = this.low >>> 16, U = this.low & 65535, k = h.high >>> 16, O = h.high & 65535, R = h.low >>> 16, D = h.low & 65535, M = 0, P = 0, X = 0, j = 0;
272
- return j += U + D, X += j >>> 16, j &= 65535, X += x + R, P += X >>> 16, X &= 65535, P += v + O, M += P >>> 16, P &= 65535, M += b + k, M &= 65535, y(X << 16 | j, M << 16 | P, this.unsigned);
273
- }, d.subtract = function(h) {
274
- return n(h) || (h = T(h)), this.add(h.neg());
275
- }, d.sub = d.subtract, d.multiply = function(h) {
276
- if (this.isZero() || (n(h) || (h = T(h)), h.isZero()))
285
+ var b = this.isNegative(), m = h.isNegative();
286
+ return b && !m ? -1 : !b && m ? 1 : this.unsigned ? h.high >>> 0 > this.high >>> 0 || h.high === this.high && h.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(h).isNegative() ? -1 : 1;
287
+ }, y.comp = y.compare, y.negate = function() {
288
+ return !this.unsigned && this.eq(L) ? L : this.not().add(p);
289
+ }, y.neg = y.negate, y.add = function(h) {
290
+ n(h) || (h = I(h));
291
+ var b = this.high >>> 16, m = this.high & 65535, x = this.low >>> 16, A = this.low & 65535, k = h.high >>> 16, O = h.high & 65535, C = h.low >>> 16, D = h.low & 65535, M = 0, B = 0, z = 0, Y = 0;
292
+ return Y += A + D, z += Y >>> 16, Y &= 65535, z += x + C, B += z >>> 16, z &= 65535, B += m + O, M += B >>> 16, B &= 65535, M += b + k, M &= 65535, E(z << 16 | Y, M << 16 | B, this.unsigned);
293
+ }, y.subtract = function(h) {
294
+ return n(h) || (h = I(h)), this.add(h.neg());
295
+ }, y.sub = y.subtract, y.multiply = function(h) {
296
+ if (this.isZero() || (n(h) || (h = I(h)), h.isZero()))
277
297
  return u;
278
- if (this.eq(_))
279
- return h.isOdd() ? _ : u;
280
- if (h.eq(_))
281
- return this.isOdd() ? _ : u;
298
+ if (this.eq(L))
299
+ return h.isOdd() ? L : u;
300
+ if (h.eq(L))
301
+ return this.isOdd() ? L : u;
282
302
  if (this.isNegative())
283
303
  return h.isNegative() ? this.neg().mul(h.neg()) : this.neg().mul(h).neg();
284
304
  if (h.isNegative())
285
305
  return this.mul(h.neg()).neg();
286
306
  if (this.lt(o) && h.lt(o))
287
- return w(this.toNumber() * h.toNumber(), this.unsigned);
288
- var b = this.high >>> 16, v = this.high & 65535, x = this.low >>> 16, U = this.low & 65535, k = h.high >>> 16, O = h.high & 65535, R = h.low >>> 16, D = h.low & 65535, M = 0, P = 0, X = 0, j = 0;
289
- return j += U * D, X += j >>> 16, j &= 65535, X += x * D, P += X >>> 16, X &= 65535, X += U * R, P += X >>> 16, X &= 65535, P += v * D, M += P >>> 16, P &= 65535, P += x * R, M += P >>> 16, P &= 65535, P += U * O, M += P >>> 16, P &= 65535, M += b * D + v * R + x * O + U * k, M &= 65535, y(X << 16 | j, M << 16 | P, this.unsigned);
290
- }, d.mul = d.multiply, d.divide = function(h) {
291
- if (n(h) || (h = T(h)), h.isZero())
307
+ return d(this.toNumber() * h.toNumber(), this.unsigned);
308
+ var b = this.high >>> 16, m = this.high & 65535, x = this.low >>> 16, A = this.low & 65535, k = h.high >>> 16, O = h.high & 65535, C = h.low >>> 16, D = h.low & 65535, M = 0, B = 0, z = 0, Y = 0;
309
+ return Y += A * D, z += Y >>> 16, Y &= 65535, z += x * D, B += z >>> 16, z &= 65535, z += A * C, B += z >>> 16, z &= 65535, B += m * D, M += B >>> 16, B &= 65535, B += x * C, M += B >>> 16, B &= 65535, B += A * O, M += B >>> 16, B &= 65535, M += b * D + m * C + x * O + A * k, M &= 65535, E(z << 16 | Y, M << 16 | B, this.unsigned);
310
+ }, y.mul = y.multiply, y.divide = function(h) {
311
+ if (n(h) || (h = I(h)), h.isZero())
292
312
  throw Error("division by zero");
293
313
  if (this.isZero())
294
314
  return this.unsigned ? l : u;
295
- var b, v, x;
315
+ var b, m, x;
296
316
  if (this.unsigned) {
297
317
  if (h.unsigned || (h = h.toUnsigned()), h.gt(this))
298
318
  return l;
@@ -300,14 +320,14 @@ function ft() {
300
320
  return F;
301
321
  x = l;
302
322
  } else {
303
- if (this.eq(_)) {
323
+ if (this.eq(L)) {
304
324
  if (h.eq(p) || h.eq(S))
305
- return _;
306
- if (h.eq(_))
325
+ return L;
326
+ if (h.eq(L))
307
327
  return p;
308
- var U = this.shr(1);
309
- return b = U.div(h).shl(1), b.eq(u) ? h.isNegative() ? p : S : (v = this.sub(h.mul(b)), x = b.add(v.div(h)), x);
310
- } else if (h.eq(_))
328
+ var A = this.shr(1);
329
+ return b = A.div(h).shl(1), b.eq(u) ? h.isNegative() ? p : S : (m = this.sub(h.mul(b)), x = b.add(m.div(h)), x);
330
+ } else if (h.eq(L))
311
331
  return this.unsigned ? l : u;
312
332
  if (this.isNegative())
313
333
  return h.isNegative() ? this.neg().div(h.neg()) : this.neg().div(h).neg();
@@ -315,60 +335,60 @@ function ft() {
315
335
  return this.div(h.neg()).neg();
316
336
  x = u;
317
337
  }
318
- for (v = this; v.gte(h); ) {
319
- b = Math.max(1, Math.floor(v.toNumber() / h.toNumber()));
320
- for (var k = Math.ceil(Math.log(b) / Math.LN2), O = k <= 48 ? 1 : I(2, k - 48), R = w(b), D = R.mul(h); D.isNegative() || D.gt(v); )
321
- b -= O, R = w(b, this.unsigned), D = R.mul(h);
322
- R.isZero() && (R = p), x = x.add(R), v = v.sub(D);
338
+ for (m = this; m.gte(h); ) {
339
+ b = Math.max(1, Math.floor(m.toNumber() / h.toNumber()));
340
+ for (var k = Math.ceil(Math.log(b) / Math.LN2), O = k <= 48 ? 1 : T(2, k - 48), C = d(b), D = C.mul(h); D.isNegative() || D.gt(m); )
341
+ b -= O, C = d(b, this.unsigned), D = C.mul(h);
342
+ C.isZero() && (C = p), x = x.add(C), m = m.sub(D);
323
343
  }
324
344
  return x;
325
- }, d.div = d.divide, d.modulo = function(h) {
326
- return n(h) || (h = T(h)), this.sub(this.div(h).mul(h));
327
- }, d.mod = d.modulo, d.not = function() {
328
- return y(~this.low, ~this.high, this.unsigned);
329
- }, d.and = function(h) {
330
- return n(h) || (h = T(h)), y(this.low & h.low, this.high & h.high, this.unsigned);
331
- }, d.or = function(h) {
332
- return n(h) || (h = T(h)), y(this.low | h.low, this.high | h.high, this.unsigned);
333
- }, d.xor = function(h) {
334
- return n(h) || (h = T(h)), y(this.low ^ h.low, this.high ^ h.high, this.unsigned);
335
- }, d.shiftLeft = function(h) {
336
- return n(h) && (h = h.toInt()), (h &= 63) === 0 ? this : h < 32 ? y(this.low << h, this.high << h | this.low >>> 32 - h, this.unsigned) : y(0, this.low << h - 32, this.unsigned);
337
- }, d.shl = d.shiftLeft, d.shiftRight = function(h) {
338
- return n(h) && (h = h.toInt()), (h &= 63) === 0 ? this : h < 32 ? y(this.low >>> h | this.high << 32 - h, this.high >> h, this.unsigned) : y(this.high >> h - 32, this.high >= 0 ? 0 : -1, this.unsigned);
339
- }, d.shr = d.shiftRight, d.shiftRightUnsigned = function(h) {
345
+ }, y.div = y.divide, y.modulo = function(h) {
346
+ return n(h) || (h = I(h)), this.sub(this.div(h).mul(h));
347
+ }, y.mod = y.modulo, y.not = function() {
348
+ return E(~this.low, ~this.high, this.unsigned);
349
+ }, y.and = function(h) {
350
+ return n(h) || (h = I(h)), E(this.low & h.low, this.high & h.high, this.unsigned);
351
+ }, y.or = function(h) {
352
+ return n(h) || (h = I(h)), E(this.low | h.low, this.high | h.high, this.unsigned);
353
+ }, y.xor = function(h) {
354
+ return n(h) || (h = I(h)), E(this.low ^ h.low, this.high ^ h.high, this.unsigned);
355
+ }, y.shiftLeft = function(h) {
356
+ return n(h) && (h = h.toInt()), (h &= 63) === 0 ? this : h < 32 ? E(this.low << h, this.high << h | this.low >>> 32 - h, this.unsigned) : E(0, this.low << h - 32, this.unsigned);
357
+ }, y.shl = y.shiftLeft, y.shiftRight = function(h) {
358
+ return n(h) && (h = h.toInt()), (h &= 63) === 0 ? this : h < 32 ? E(this.low >>> h | this.high << 32 - h, this.high >> h, this.unsigned) : E(this.high >> h - 32, this.high >= 0 ? 0 : -1, this.unsigned);
359
+ }, y.shr = y.shiftRight, y.shiftRightUnsigned = function(h) {
340
360
  if (n(h) && (h = h.toInt()), h &= 63, h === 0)
341
361
  return this;
342
362
  var b = this.high;
343
363
  if (h < 32) {
344
- var v = this.low;
345
- return y(v >>> h | b << 32 - h, b >>> h, this.unsigned);
346
- } else return h === 32 ? y(b, 0, this.unsigned) : y(b >>> h - 32, 0, this.unsigned);
347
- }, d.shru = d.shiftRightUnsigned, d.toSigned = function() {
348
- return this.unsigned ? y(this.low, this.high, !1) : this;
349
- }, d.toUnsigned = function() {
350
- return this.unsigned ? this : y(this.low, this.high, !0);
351
- }, d.toBytes = function(f) {
352
- return f ? this.toBytesLE() : this.toBytesBE();
353
- }, d.toBytesLE = function() {
354
- var f = this.high, h = this.low;
364
+ var m = this.low;
365
+ return E(m >>> h | b << 32 - h, b >>> h, this.unsigned);
366
+ } else return h === 32 ? E(b, 0, this.unsigned) : E(b >>> h - 32, 0, this.unsigned);
367
+ }, y.shru = y.shiftRightUnsigned, y.toSigned = function() {
368
+ return this.unsigned ? E(this.low, this.high, !1) : this;
369
+ }, y.toUnsigned = function() {
370
+ return this.unsigned ? this : E(this.low, this.high, !0);
371
+ }, y.toBytes = function(g) {
372
+ return g ? this.toBytesLE() : this.toBytesBE();
373
+ }, y.toBytesLE = function() {
374
+ var g = this.high, h = this.low;
355
375
  return [
356
376
  h & 255,
357
377
  h >>> 8 & 255,
358
378
  h >>> 16 & 255,
359
379
  h >>> 24 & 255,
360
- f & 255,
361
- f >>> 8 & 255,
362
- f >>> 16 & 255,
363
- f >>> 24 & 255
380
+ g & 255,
381
+ g >>> 8 & 255,
382
+ g >>> 16 & 255,
383
+ g >>> 24 & 255
364
384
  ];
365
- }, d.toBytesBE = function() {
366
- var f = this.high, h = this.low;
385
+ }, y.toBytesBE = function() {
386
+ var g = this.high, h = this.low;
367
387
  return [
368
- f >>> 24 & 255,
369
- f >>> 16 & 255,
370
- f >>> 8 & 255,
371
- f & 255,
388
+ g >>> 24 & 255,
389
+ g >>> 16 & 255,
390
+ g >>> 8 & 255,
391
+ g & 255,
372
392
  h >>> 24 & 255,
373
393
  h >>> 16 & 255,
374
394
  h >>> 8 & 255,
@@ -376,11 +396,11 @@ function ft() {
376
396
  ];
377
397
  }, i;
378
398
  });
379
- }(K)), K.exports;
399
+ }(J)), J.exports;
380
400
  }
381
- var gt = W.exports, nt;
382
- function pt() {
383
- return nt || (nt = 1, function(g) {
401
+ var bt = K.exports, ot;
402
+ function Et() {
403
+ return ot || (ot = 1, function(f) {
384
404
  /**
385
405
  * @license bytebuffer.js (c) 2015 Daniel Wirtz <dcode@dcode.io>
386
406
  * Backing buffer: ArrayBuffer, Accessor: Uint8Array
@@ -388,15 +408,15 @@ function pt() {
388
408
  * see: https://github.com/dcodeIO/bytebuffer.js for details
389
409
  */
390
410
  (function(i, n) {
391
- typeof st == "function" && g && g.exports ? g.exports = function() {
392
- var a;
411
+ typeof ut == "function" && f && f.exports ? f.exports = function() {
412
+ var s;
393
413
  try {
394
- a = ft();
414
+ s = wt();
395
415
  } catch {
396
416
  }
397
- return n(a);
417
+ return n(s);
398
418
  }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long);
399
- })(gt, function(i) {
419
+ })(bt, function(i) {
400
420
  var n = function(t, e, r) {
401
421
  if (typeof t > "u" && (t = n.DEFAULT_CAPACITY), typeof e > "u" && (e = n.DEFAULT_ENDIAN), typeof r > "u" && (r = n.DEFAULT_NOASSERT), !r) {
402
422
  if (t = t | 0, t < 0)
@@ -406,38 +426,38 @@ function pt() {
406
426
  this.buffer = t === 0 ? c : new ArrayBuffer(t), this.view = t === 0 ? null : new Uint8Array(this.buffer), this.offset = 0, this.markedOffset = -1, this.limit = t, this.littleEndian = e, this.noAssert = r;
407
427
  };
408
428
  n.VERSION = "5.0.1", n.LITTLE_ENDIAN = !0, n.BIG_ENDIAN = !1, n.DEFAULT_CAPACITY = 16, n.DEFAULT_ENDIAN = n.BIG_ENDIAN, n.DEFAULT_NOASSERT = !1, n.Long = i || null;
409
- var a = n.prototype;
410
- a.__isByteBuffer__, Object.defineProperty(a, "__isByteBuffer__", {
429
+ var s = n.prototype;
430
+ s.__isByteBuffer__, Object.defineProperty(s, "__isByteBuffer__", {
411
431
  value: !0,
412
432
  enumerable: !1,
413
433
  configurable: !1
414
434
  });
415
- var c = new ArrayBuffer(0), E = String.fromCharCode;
416
- function w(t) {
435
+ var c = new ArrayBuffer(0), w = String.fromCharCode;
436
+ function d(t) {
417
437
  var e = 0;
418
438
  return function() {
419
439
  return e < t.length ? t.charCodeAt(e++) : null;
420
440
  };
421
441
  }
422
- function y() {
442
+ function E() {
423
443
  var t = [], e = [];
424
444
  return function() {
425
445
  if (arguments.length === 0)
426
- return e.join("") + E.apply(String, t);
427
- t.length + arguments.length > 1024 && (e.push(E.apply(String, t)), t.length = 0), Array.prototype.push.apply(t, arguments);
446
+ return e.join("") + w.apply(String, t);
447
+ t.length + arguments.length > 1024 && (e.push(w.apply(String, t)), t.length = 0), Array.prototype.push.apply(t, arguments);
428
448
  };
429
449
  }
430
450
  n.accessor = function() {
431
451
  return Uint8Array;
432
452
  }, n.allocate = function(t, e, r) {
433
453
  return new n(t, e, r);
434
- }, n.concat = function(t, e, r, s) {
435
- (typeof e == "boolean" || typeof e != "string") && (s = r, r = e, e = void 0);
454
+ }, n.concat = function(t, e, r, a) {
455
+ (typeof e == "boolean" || typeof e != "string") && (a = r, r = e, e = void 0);
436
456
  for (var o = 0, u = 0, l = t.length, p; u < l; ++u)
437
457
  n.isByteBuffer(t[u]) || (t[u] = n.wrap(t[u], e)), p = t[u].limit - t[u].offset, p > 0 && (o += p);
438
458
  if (o === 0)
439
- return new n(0, r, s);
440
- var F = new n(o, r, s), S;
459
+ return new n(0, r, a);
460
+ var F = new n(o, r, a), S;
441
461
  for (u = 0; u < l; )
442
462
  S = t[u++], p = S.limit - S.offset, !(p <= 0) && (F.view.set(S.view.subarray(S.offset, S.limit), F.offset), F.offset += p);
443
463
  return F.limit = F.offset, F.offset = 0, F;
@@ -445,8 +465,8 @@ function pt() {
445
465
  return (t && t.__isByteBuffer__) === !0;
446
466
  }, n.type = function() {
447
467
  return ArrayBuffer;
448
- }, n.wrap = function(t, e, r, s) {
449
- if (typeof e != "string" && (s = r, r = e, e = void 0), typeof t == "string")
468
+ }, n.wrap = function(t, e, r, a) {
469
+ if (typeof e != "string" && (a = r, r = e, e = void 0), typeof t == "string")
450
470
  switch (typeof e > "u" && (e = "utf8"), e) {
451
471
  case "base64":
452
472
  return n.fromBase64(t, r);
@@ -465,19 +485,19 @@ function pt() {
465
485
  throw TypeError("Illegal buffer");
466
486
  var o;
467
487
  if (n.isByteBuffer(t))
468
- return o = a.clone.call(t), o.markedOffset = -1, o;
488
+ return o = s.clone.call(t), o.markedOffset = -1, o;
469
489
  if (t instanceof Uint8Array)
470
- o = new n(0, r, s), t.length > 0 && (o.buffer = t.buffer, o.offset = t.byteOffset, o.limit = t.byteOffset + t.byteLength, o.view = new Uint8Array(t.buffer));
490
+ o = new n(0, r, a), t.length > 0 && (o.buffer = t.buffer, o.offset = t.byteOffset, o.limit = t.byteOffset + t.byteLength, o.view = new Uint8Array(t.buffer));
471
491
  else if (t instanceof ArrayBuffer)
472
- o = new n(0, r, s), t.byteLength > 0 && (o.buffer = t, o.offset = 0, o.limit = t.byteLength, o.view = t.byteLength > 0 ? new Uint8Array(t) : null);
492
+ o = new n(0, r, a), t.byteLength > 0 && (o.buffer = t, o.offset = 0, o.limit = t.byteLength, o.view = t.byteLength > 0 ? new Uint8Array(t) : null);
473
493
  else if (Object.prototype.toString.call(t) === "[object Array]") {
474
- o = new n(t.length, r, s), o.limit = t.length;
494
+ o = new n(t.length, r, a), o.limit = t.length;
475
495
  for (var u = 0; u < t.length; ++u)
476
496
  o.view[u] = t[u];
477
497
  } else
478
498
  throw TypeError("Illegal buffer");
479
499
  return o;
480
- }, a.writeBitSet = function(t, e) {
500
+ }, s.writeBitSet = function(t, e) {
481
501
  var r = typeof e > "u";
482
502
  if (r && (e = this.offset), !this.noAssert) {
483
503
  if (!(t instanceof Array))
@@ -487,7 +507,7 @@ function pt() {
487
507
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
488
508
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
489
509
  }
490
- var s = e, o = t.length, u = o >> 3, l = 0, p;
510
+ var a = e, o = t.length, u = o >> 3, l = 0, p;
491
511
  for (e += this.writeVarint32(o, e); u--; )
492
512
  p = !!t[l++] & 1 | (!!t[l++] & 1) << 1 | (!!t[l++] & 1) << 2 | (!!t[l++] & 1) << 3 | (!!t[l++] & 1) << 4 | (!!t[l++] & 1) << 5 | (!!t[l++] & 1) << 6 | (!!t[l++] & 1) << 7, this.writeByte(p, e++);
493
513
  if (l < o) {
@@ -495,19 +515,19 @@ function pt() {
495
515
  for (p = 0; l < o; ) p = p | (!!t[l++] & 1) << F++;
496
516
  this.writeByte(p, e++);
497
517
  }
498
- return r ? (this.offset = e, this) : e - s;
499
- }, a.readBitSet = function(t) {
518
+ return r ? (this.offset = e, this) : e - a;
519
+ }, s.readBitSet = function(t) {
500
520
  var e = typeof t > "u";
501
521
  e && (t = this.offset);
502
- var r = this.readVarint32(t), s = r.value, o = s >> 3, u = 0, l = [], p;
522
+ var r = this.readVarint32(t), a = r.value, o = a >> 3, u = 0, l = [], p;
503
523
  for (t += r.length; o--; )
504
524
  p = this.readByte(t++), l[u++] = !!(p & 1), l[u++] = !!(p & 2), l[u++] = !!(p & 4), l[u++] = !!(p & 8), l[u++] = !!(p & 16), l[u++] = !!(p & 32), l[u++] = !!(p & 64), l[u++] = !!(p & 128);
505
- if (u < s) {
525
+ if (u < a) {
506
526
  var F = 0;
507
- for (p = this.readByte(t++); u < s; ) l[u++] = !!(p >> F++ & 1);
527
+ for (p = this.readByte(t++); u < a; ) l[u++] = !!(p >> F++ & 1);
508
528
  }
509
529
  return e && (this.offset = t), l;
510
- }, a.readBytes = function(t, e) {
530
+ }, s.readBytes = function(t, e) {
511
531
  var r = typeof e > "u";
512
532
  if (r && (e = this.offset), !this.noAssert) {
513
533
  if (typeof e != "number" || e % 1 !== 0)
@@ -515,9 +535,9 @@ function pt() {
515
535
  if (e >>>= 0, e < 0 || e + t > this.buffer.byteLength)
516
536
  throw RangeError("Illegal offset: 0 <= " + e + " (+" + t + ") <= " + this.buffer.byteLength);
517
537
  }
518
- var s = this.slice(e, e + t);
519
- return r && (this.offset += t), s;
520
- }, a.writeBytes = a.append, a.writeInt8 = function(t, e) {
538
+ var a = this.slice(e, e + t);
539
+ return r && (this.offset += t), a;
540
+ }, s.writeBytes = s.append, s.writeInt8 = function(t, e) {
521
541
  var r = typeof e > "u";
522
542
  if (r && (e = this.offset), !this.noAssert) {
523
543
  if (typeof t != "number" || t % 1 !== 0)
@@ -528,9 +548,9 @@ function pt() {
528
548
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
529
549
  }
530
550
  e += 1;
531
- var s = this.buffer.byteLength;
532
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 1, this.view[e] = t, r && (this.offset += 1), this;
533
- }, a.writeByte = a.writeInt8, a.readInt8 = function(t) {
551
+ var a = this.buffer.byteLength;
552
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 1, this.view[e] = t, r && (this.offset += 1), this;
553
+ }, s.writeByte = s.writeInt8, s.readInt8 = function(t) {
534
554
  var e = typeof t > "u";
535
555
  if (e && (t = this.offset), !this.noAssert) {
536
556
  if (typeof t != "number" || t % 1 !== 0)
@@ -540,7 +560,7 @@ function pt() {
540
560
  }
541
561
  var r = this.view[t];
542
562
  return (r & 128) === 128 && (r = -(255 - r + 1)), e && (this.offset += 1), r;
543
- }, a.readByte = a.readInt8, a.writeUint8 = function(t, e) {
563
+ }, s.readByte = s.readInt8, s.writeUint8 = function(t, e) {
544
564
  var r = typeof e > "u";
545
565
  if (r && (e = this.offset), !this.noAssert) {
546
566
  if (typeof t != "number" || t % 1 !== 0)
@@ -551,9 +571,9 @@ function pt() {
551
571
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
552
572
  }
553
573
  e += 1;
554
- var s = this.buffer.byteLength;
555
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 1, this.view[e] = t, r && (this.offset += 1), this;
556
- }, a.writeUInt8 = a.writeUint8, a.readUint8 = function(t) {
574
+ var a = this.buffer.byteLength;
575
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 1, this.view[e] = t, r && (this.offset += 1), this;
576
+ }, s.writeUInt8 = s.writeUint8, s.readUint8 = function(t) {
557
577
  var e = typeof t > "u";
558
578
  if (e && (t = this.offset), !this.noAssert) {
559
579
  if (typeof t != "number" || t % 1 !== 0)
@@ -563,7 +583,7 @@ function pt() {
563
583
  }
564
584
  var r = this.view[t];
565
585
  return e && (this.offset += 1), r;
566
- }, a.readUInt8 = a.readUint8, a.writeInt16 = function(t, e) {
586
+ }, s.readUInt8 = s.readUint8, s.writeInt16 = function(t, e) {
567
587
  var r = typeof e > "u";
568
588
  if (r && (e = this.offset), !this.noAssert) {
569
589
  if (typeof t != "number" || t % 1 !== 0)
@@ -574,9 +594,9 @@ function pt() {
574
594
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
575
595
  }
576
596
  e += 2;
577
- var s = this.buffer.byteLength;
578
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (t & 65280) >>> 8, this.view[e] = t & 255) : (this.view[e] = (t & 65280) >>> 8, this.view[e + 1] = t & 255), r && (this.offset += 2), this;
579
- }, a.writeShort = a.writeInt16, a.readInt16 = function(t) {
597
+ var a = this.buffer.byteLength;
598
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (t & 65280) >>> 8, this.view[e] = t & 255) : (this.view[e] = (t & 65280) >>> 8, this.view[e + 1] = t & 255), r && (this.offset += 2), this;
599
+ }, s.writeShort = s.writeInt16, s.readInt16 = function(t) {
580
600
  var e = typeof t > "u";
581
601
  if (e && (t = this.offset), !this.noAssert) {
582
602
  if (typeof t != "number" || t % 1 !== 0)
@@ -586,7 +606,7 @@ function pt() {
586
606
  }
587
607
  var r = 0;
588
608
  return this.littleEndian ? (r = this.view[t], r |= this.view[t + 1] << 8) : (r = this.view[t] << 8, r |= this.view[t + 1]), (r & 32768) === 32768 && (r = -(65535 - r + 1)), e && (this.offset += 2), r;
589
- }, a.readShort = a.readInt16, a.writeUint16 = function(t, e) {
609
+ }, s.readShort = s.readInt16, s.writeUint16 = function(t, e) {
590
610
  var r = typeof e > "u";
591
611
  if (r && (e = this.offset), !this.noAssert) {
592
612
  if (typeof t != "number" || t % 1 !== 0)
@@ -597,9 +617,9 @@ function pt() {
597
617
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
598
618
  }
599
619
  e += 2;
600
- var s = this.buffer.byteLength;
601
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (t & 65280) >>> 8, this.view[e] = t & 255) : (this.view[e] = (t & 65280) >>> 8, this.view[e + 1] = t & 255), r && (this.offset += 2), this;
602
- }, a.writeUInt16 = a.writeUint16, a.readUint16 = function(t) {
620
+ var a = this.buffer.byteLength;
621
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 2, this.littleEndian ? (this.view[e + 1] = (t & 65280) >>> 8, this.view[e] = t & 255) : (this.view[e] = (t & 65280) >>> 8, this.view[e + 1] = t & 255), r && (this.offset += 2), this;
622
+ }, s.writeUInt16 = s.writeUint16, s.readUint16 = function(t) {
603
623
  var e = typeof t > "u";
604
624
  if (e && (t = this.offset), !this.noAssert) {
605
625
  if (typeof t != "number" || t % 1 !== 0)
@@ -609,7 +629,7 @@ function pt() {
609
629
  }
610
630
  var r = 0;
611
631
  return this.littleEndian ? (r = this.view[t], r |= this.view[t + 1] << 8) : (r = this.view[t] << 8, r |= this.view[t + 1]), e && (this.offset += 2), r;
612
- }, a.readUInt16 = a.readUint16, a.writeInt32 = function(t, e) {
632
+ }, s.readUInt16 = s.readUint16, s.writeInt32 = function(t, e) {
613
633
  var r = typeof e > "u";
614
634
  if (r && (e = this.offset), !this.noAssert) {
615
635
  if (typeof t != "number" || t % 1 !== 0)
@@ -620,9 +640,9 @@ function pt() {
620
640
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
621
641
  }
622
642
  e += 4;
623
- var s = this.buffer.byteLength;
624
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = t & 255) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = t & 255), r && (this.offset += 4), this;
625
- }, a.writeInt = a.writeInt32, a.readInt32 = function(t) {
643
+ var a = this.buffer.byteLength;
644
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = t & 255) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = t & 255), r && (this.offset += 4), this;
645
+ }, s.writeInt = s.writeInt32, s.readInt32 = function(t) {
626
646
  var e = typeof t > "u";
627
647
  if (e && (t = this.offset), !this.noAssert) {
628
648
  if (typeof t != "number" || t % 1 !== 0)
@@ -632,7 +652,7 @@ function pt() {
632
652
  }
633
653
  var r = 0;
634
654
  return this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0), r |= 0, e && (this.offset += 4), r;
635
- }, a.readInt = a.readInt32, a.writeUint32 = function(t, e) {
655
+ }, s.readInt = s.readInt32, s.writeUint32 = function(t, e) {
636
656
  var r = typeof e > "u";
637
657
  if (r && (e = this.offset), !this.noAssert) {
638
658
  if (typeof t != "number" || t % 1 !== 0)
@@ -643,9 +663,9 @@ function pt() {
643
663
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
644
664
  }
645
665
  e += 4;
646
- var s = this.buffer.byteLength;
647
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = t & 255) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = t & 255), r && (this.offset += 4), this;
648
- }, a.writeUInt32 = a.writeUint32, a.readUint32 = function(t) {
666
+ var a = this.buffer.byteLength;
667
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 4, this.littleEndian ? (this.view[e + 3] = t >>> 24 & 255, this.view[e + 2] = t >>> 16 & 255, this.view[e + 1] = t >>> 8 & 255, this.view[e] = t & 255) : (this.view[e] = t >>> 24 & 255, this.view[e + 1] = t >>> 16 & 255, this.view[e + 2] = t >>> 8 & 255, this.view[e + 3] = t & 255), r && (this.offset += 4), this;
668
+ }, s.writeUInt32 = s.writeUint32, s.readUint32 = function(t) {
649
669
  var e = typeof t > "u";
650
670
  if (e && (t = this.offset), !this.noAssert) {
651
671
  if (typeof t != "number" || t % 1 !== 0)
@@ -655,7 +675,7 @@ function pt() {
655
675
  }
656
676
  var r = 0;
657
677
  return this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0), e && (this.offset += 4), r;
658
- }, a.readUInt32 = a.readUint32, i && (a.writeInt64 = function(t, e) {
678
+ }, s.readUInt32 = s.readUint32, i && (s.writeInt64 = function(t, e) {
659
679
  var r = typeof e > "u";
660
680
  if (r && (e = this.offset), !this.noAssert) {
661
681
  if (typeof t == "number")
@@ -670,11 +690,11 @@ function pt() {
670
690
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
671
691
  }
672
692
  typeof t == "number" ? t = i.fromNumber(t) : typeof t == "string" && (t = i.fromString(t)), e += 8;
673
- var s = this.buffer.byteLength;
674
- e > s && this.resize((s *= 2) > e ? s : e), e -= 8;
693
+ var a = this.buffer.byteLength;
694
+ e > a && this.resize((a *= 2) > e ? a : e), e -= 8;
675
695
  var o = t.low, u = t.high;
676
696
  return this.littleEndian ? (this.view[e + 3] = o >>> 24 & 255, this.view[e + 2] = o >>> 16 & 255, this.view[e + 1] = o >>> 8 & 255, this.view[e] = o & 255, e += 4, this.view[e + 3] = u >>> 24 & 255, this.view[e + 2] = u >>> 16 & 255, this.view[e + 1] = u >>> 8 & 255, this.view[e] = u & 255) : (this.view[e] = u >>> 24 & 255, this.view[e + 1] = u >>> 16 & 255, this.view[e + 2] = u >>> 8 & 255, this.view[e + 3] = u & 255, e += 4, this.view[e] = o >>> 24 & 255, this.view[e + 1] = o >>> 16 & 255, this.view[e + 2] = o >>> 8 & 255, this.view[e + 3] = o & 255), r && (this.offset += 8), this;
677
- }, a.writeLong = a.writeInt64, a.readInt64 = function(t) {
697
+ }, s.writeLong = s.writeInt64, s.readInt64 = function(t) {
678
698
  var e = typeof t > "u";
679
699
  if (e && (t = this.offset), !this.noAssert) {
680
700
  if (typeof t != "number" || t % 1 !== 0)
@@ -682,11 +702,11 @@ function pt() {
682
702
  if (t >>>= 0, t < 0 || t + 8 > this.buffer.byteLength)
683
703
  throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength);
684
704
  }
685
- var r = 0, s = 0;
686
- this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0, t += 4, s = this.view[t + 2] << 16, s |= this.view[t + 1] << 8, s |= this.view[t], s += this.view[t + 3] << 24 >>> 0) : (s = this.view[t + 1] << 16, s |= this.view[t + 2] << 8, s |= this.view[t + 3], s += this.view[t] << 24 >>> 0, t += 4, r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0);
687
- var o = new i(r, s, !1);
705
+ var r = 0, a = 0;
706
+ this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0, t += 4, a = this.view[t + 2] << 16, a |= this.view[t + 1] << 8, a |= this.view[t], a += this.view[t + 3] << 24 >>> 0) : (a = this.view[t + 1] << 16, a |= this.view[t + 2] << 8, a |= this.view[t + 3], a += this.view[t] << 24 >>> 0, t += 4, r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0);
707
+ var o = new i(r, a, !1);
688
708
  return e && (this.offset += 8), o;
689
- }, a.readLong = a.readInt64, a.writeUint64 = function(t, e) {
709
+ }, s.readLong = s.readInt64, s.writeUint64 = function(t, e) {
690
710
  var r = typeof e > "u";
691
711
  if (r && (e = this.offset), !this.noAssert) {
692
712
  if (typeof t == "number")
@@ -701,11 +721,11 @@ function pt() {
701
721
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
702
722
  }
703
723
  typeof t == "number" ? t = i.fromNumber(t) : typeof t == "string" && (t = i.fromString(t)), e += 8;
704
- var s = this.buffer.byteLength;
705
- e > s && this.resize((s *= 2) > e ? s : e), e -= 8;
724
+ var a = this.buffer.byteLength;
725
+ e > a && this.resize((a *= 2) > e ? a : e), e -= 8;
706
726
  var o = t.low, u = t.high;
707
727
  return this.littleEndian ? (this.view[e + 3] = o >>> 24 & 255, this.view[e + 2] = o >>> 16 & 255, this.view[e + 1] = o >>> 8 & 255, this.view[e] = o & 255, e += 4, this.view[e + 3] = u >>> 24 & 255, this.view[e + 2] = u >>> 16 & 255, this.view[e + 1] = u >>> 8 & 255, this.view[e] = u & 255) : (this.view[e] = u >>> 24 & 255, this.view[e + 1] = u >>> 16 & 255, this.view[e + 2] = u >>> 8 & 255, this.view[e + 3] = u & 255, e += 4, this.view[e] = o >>> 24 & 255, this.view[e + 1] = o >>> 16 & 255, this.view[e + 2] = o >>> 8 & 255, this.view[e + 3] = o & 255), r && (this.offset += 8), this;
708
- }, a.writeUInt64 = a.writeUint64, a.readUint64 = function(t) {
728
+ }, s.writeUInt64 = s.writeUint64, s.readUint64 = function(t) {
709
729
  var e = typeof t > "u";
710
730
  if (e && (t = this.offset), !this.noAssert) {
711
731
  if (typeof t != "number" || t % 1 !== 0)
@@ -713,35 +733,35 @@ function pt() {
713
733
  if (t >>>= 0, t < 0 || t + 8 > this.buffer.byteLength)
714
734
  throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength);
715
735
  }
716
- var r = 0, s = 0;
717
- this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0, t += 4, s = this.view[t + 2] << 16, s |= this.view[t + 1] << 8, s |= this.view[t], s += this.view[t + 3] << 24 >>> 0) : (s = this.view[t + 1] << 16, s |= this.view[t + 2] << 8, s |= this.view[t + 3], s += this.view[t] << 24 >>> 0, t += 4, r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0);
718
- var o = new i(r, s, !0);
736
+ var r = 0, a = 0;
737
+ this.littleEndian ? (r = this.view[t + 2] << 16, r |= this.view[t + 1] << 8, r |= this.view[t], r += this.view[t + 3] << 24 >>> 0, t += 4, a = this.view[t + 2] << 16, a |= this.view[t + 1] << 8, a |= this.view[t], a += this.view[t + 3] << 24 >>> 0) : (a = this.view[t + 1] << 16, a |= this.view[t + 2] << 8, a |= this.view[t + 3], a += this.view[t] << 24 >>> 0, t += 4, r = this.view[t + 1] << 16, r |= this.view[t + 2] << 8, r |= this.view[t + 3], r += this.view[t] << 24 >>> 0);
738
+ var o = new i(r, a, !0);
719
739
  return e && (this.offset += 8), o;
720
- }, a.readUInt64 = a.readUint64);
721
- function I(t, e, r, s, o) {
722
- var u, l, p = o * 8 - s - 1, F = (1 << p) - 1, S = F >> 1, A = -7, L = r ? o - 1 : 0, _ = r ? -1 : 1, d = t[e + L];
723
- for (L += _, u = d & (1 << -A) - 1, d >>= -A, A += p; A > 0; u = u * 256 + t[e + L], L += _, A -= 8)
740
+ }, s.readUInt64 = s.readUint64);
741
+ function T(t, e, r, a, o) {
742
+ var u, l, p = o * 8 - a - 1, F = (1 << p) - 1, S = F >> 1, N = -7, _ = r ? o - 1 : 0, L = r ? -1 : 1, y = t[e + _];
743
+ for (_ += L, u = y & (1 << -N) - 1, y >>= -N, N += p; N > 0; u = u * 256 + t[e + _], _ += L, N -= 8)
724
744
  ;
725
- for (l = u & (1 << -A) - 1, u >>= -A, A += s; A > 0; l = l * 256 + t[e + L], L += _, A -= 8)
745
+ for (l = u & (1 << -N) - 1, u >>= -N, N += a; N > 0; l = l * 256 + t[e + _], _ += L, N -= 8)
726
746
  ;
727
747
  if (u === 0)
728
748
  u = 1 - S;
729
749
  else {
730
750
  if (u === F)
731
- return l ? NaN : (d ? -1 : 1) * (1 / 0);
732
- l = l + Math.pow(2, s), u = u - S;
751
+ return l ? NaN : (y ? -1 : 1) * (1 / 0);
752
+ l = l + Math.pow(2, a), u = u - S;
733
753
  }
734
- return (d ? -1 : 1) * l * Math.pow(2, u - s);
754
+ return (y ? -1 : 1) * l * Math.pow(2, u - a);
735
755
  }
736
- function N(t, e, r, s, o, u) {
737
- var l, p, F, S = u * 8 - o - 1, A = (1 << S) - 1, L = A >> 1, _ = o === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = s ? 0 : u - 1, f = s ? 1 : -1, h = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
738
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (p = isNaN(e) ? 1 : 0, l = A) : (l = Math.floor(Math.log(e) / Math.LN2), e * (F = Math.pow(2, -l)) < 1 && (l--, F *= 2), l + L >= 1 ? e += _ / F : e += _ * Math.pow(2, 1 - L), e * F >= 2 && (l++, F /= 2), l + L >= A ? (p = 0, l = A) : l + L >= 1 ? (p = (e * F - 1) * Math.pow(2, o), l = l + L) : (p = e * Math.pow(2, L - 1) * Math.pow(2, o), l = 0)); o >= 8; t[r + d] = p & 255, d += f, p /= 256, o -= 8)
756
+ function U(t, e, r, a, o, u) {
757
+ var l, p, F, S = u * 8 - o - 1, N = (1 << S) - 1, _ = N >> 1, L = o === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, y = a ? 0 : u - 1, g = a ? 1 : -1, h = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
758
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (p = isNaN(e) ? 1 : 0, l = N) : (l = Math.floor(Math.log(e) / Math.LN2), e * (F = Math.pow(2, -l)) < 1 && (l--, F *= 2), l + _ >= 1 ? e += L / F : e += L * Math.pow(2, 1 - _), e * F >= 2 && (l++, F /= 2), l + _ >= N ? (p = 0, l = N) : l + _ >= 1 ? (p = (e * F - 1) * Math.pow(2, o), l = l + _) : (p = e * Math.pow(2, _ - 1) * Math.pow(2, o), l = 0)); o >= 8; t[r + y] = p & 255, y += g, p /= 256, o -= 8)
739
759
  ;
740
- for (l = l << o | p, S += o; S > 0; t[r + d] = l & 255, d += f, l /= 256, S -= 8)
760
+ for (l = l << o | p, S += o; S > 0; t[r + y] = l & 255, y += g, l /= 256, S -= 8)
741
761
  ;
742
- t[r + d - f] |= h * 128;
762
+ t[r + y - g] |= h * 128;
743
763
  }
744
- a.writeFloat32 = function(t, e) {
764
+ s.writeFloat32 = function(t, e) {
745
765
  var r = typeof e > "u";
746
766
  if (r && (e = this.offset), !this.noAssert) {
747
767
  if (typeof t != "number")
@@ -752,9 +772,9 @@ function pt() {
752
772
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
753
773
  }
754
774
  e += 4;
755
- var s = this.buffer.byteLength;
756
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 4, N(this.view, t, e, this.littleEndian, 23, 4), r && (this.offset += 4), this;
757
- }, a.writeFloat = a.writeFloat32, a.readFloat32 = function(t) {
775
+ var a = this.buffer.byteLength;
776
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 4, U(this.view, t, e, this.littleEndian, 23, 4), r && (this.offset += 4), this;
777
+ }, s.writeFloat = s.writeFloat32, s.readFloat32 = function(t) {
758
778
  var e = typeof t > "u";
759
779
  if (e && (t = this.offset), !this.noAssert) {
760
780
  if (typeof t != "number" || t % 1 !== 0)
@@ -762,9 +782,9 @@ function pt() {
762
782
  if (t >>>= 0, t < 0 || t + 4 > this.buffer.byteLength)
763
783
  throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength);
764
784
  }
765
- var r = I(this.view, t, this.littleEndian, 23, 4);
785
+ var r = T(this.view, t, this.littleEndian, 23, 4);
766
786
  return e && (this.offset += 4), r;
767
- }, a.readFloat = a.readFloat32, a.writeFloat64 = function(t, e) {
787
+ }, s.readFloat = s.readFloat32, s.writeFloat64 = function(t, e) {
768
788
  var r = typeof e > "u";
769
789
  if (r && (e = this.offset), !this.noAssert) {
770
790
  if (typeof t != "number")
@@ -775,9 +795,9 @@ function pt() {
775
795
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
776
796
  }
777
797
  e += 8;
778
- var s = this.buffer.byteLength;
779
- return e > s && this.resize((s *= 2) > e ? s : e), e -= 8, N(this.view, t, e, this.littleEndian, 52, 8), r && (this.offset += 8), this;
780
- }, a.writeDouble = a.writeFloat64, a.readFloat64 = function(t) {
798
+ var a = this.buffer.byteLength;
799
+ return e > a && this.resize((a *= 2) > e ? a : e), e -= 8, U(this.view, t, e, this.littleEndian, 52, 8), r && (this.offset += 8), this;
800
+ }, s.writeDouble = s.writeFloat64, s.readFloat64 = function(t) {
781
801
  var e = typeof t > "u";
782
802
  if (e && (t = this.offset), !this.noAssert) {
783
803
  if (typeof t != "number" || t % 1 !== 0)
@@ -785,15 +805,15 @@ function pt() {
785
805
  if (t >>>= 0, t < 0 || t + 8 > this.buffer.byteLength)
786
806
  throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength);
787
807
  }
788
- var r = I(this.view, t, this.littleEndian, 52, 8);
808
+ var r = T(this.view, t, this.littleEndian, 52, 8);
789
809
  return e && (this.offset += 8), r;
790
- }, a.readDouble = a.readFloat64, n.MAX_VARINT32_BYTES = 5, n.calculateVarint32 = function(t) {
810
+ }, s.readDouble = s.readFloat64, n.MAX_VARINT32_BYTES = 5, n.calculateVarint32 = function(t) {
791
811
  return t = t >>> 0, t < 128 ? 1 : t < 16384 ? 2 : t < 1 << 21 ? 3 : t < 1 << 28 ? 4 : 5;
792
812
  }, n.zigZagEncode32 = function(t) {
793
813
  return ((t |= 0) << 1 ^ t >> 31) >>> 0;
794
814
  }, n.zigZagDecode32 = function(t) {
795
815
  return t >>> 1 ^ -(t & 1) | 0;
796
- }, a.writeVarint32 = function(t, e) {
816
+ }, s.writeVarint32 = function(t, e) {
797
817
  var r = typeof e > "u";
798
818
  if (r && (e = this.offset), !this.noAssert) {
799
819
  if (typeof t != "number" || t % 1 !== 0)
@@ -803,15 +823,15 @@ function pt() {
803
823
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
804
824
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
805
825
  }
806
- var s = n.calculateVarint32(t), o;
807
- e += s;
826
+ var a = n.calculateVarint32(t), o;
827
+ e += a;
808
828
  var u = this.buffer.byteLength;
809
- for (e > u && this.resize((u *= 2) > e ? u : e), e -= s, t >>>= 0; t >= 128; )
829
+ for (e > u && this.resize((u *= 2) > e ? u : e), e -= a, t >>>= 0; t >= 128; )
810
830
  o = t & 127 | 128, this.view[e++] = o, t >>>= 7;
811
- return this.view[e++] = t, r ? (this.offset = e, this) : s;
812
- }, a.writeVarint32ZigZag = function(t, e) {
831
+ return this.view[e++] = t, r ? (this.offset = e, this) : a;
832
+ }, s.writeVarint32ZigZag = function(t, e) {
813
833
  return this.writeVarint32(n.zigZagEncode32(t), e);
814
- }, a.readVarint32 = function(t) {
834
+ }, s.readVarint32 = function(t) {
815
835
  var e = typeof t > "u";
816
836
  if (e && (t = this.offset), !this.noAssert) {
817
837
  if (typeof t != "number" || t % 1 !== 0)
@@ -819,30 +839,30 @@ function pt() {
819
839
  if (t >>>= 0, t < 0 || t + 1 > this.buffer.byteLength)
820
840
  throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength);
821
841
  }
822
- var r = 0, s = 0, o;
842
+ var r = 0, a = 0, o;
823
843
  do {
824
844
  if (!this.noAssert && t > this.limit) {
825
845
  var u = Error("Truncated");
826
846
  throw u.truncated = !0, u;
827
847
  }
828
- o = this.view[t++], r < 5 && (s |= (o & 127) << 7 * r), ++r;
848
+ o = this.view[t++], r < 5 && (a |= (o & 127) << 7 * r), ++r;
829
849
  } while ((o & 128) !== 0);
830
- return s |= 0, e ? (this.offset = t, s) : {
831
- value: s,
850
+ return a |= 0, e ? (this.offset = t, a) : {
851
+ value: a,
832
852
  length: r
833
853
  };
834
- }, a.readVarint32ZigZag = function(t) {
854
+ }, s.readVarint32ZigZag = function(t) {
835
855
  var e = this.readVarint32(t);
836
856
  return typeof e == "object" ? e.value = n.zigZagDecode32(e.value) : e = n.zigZagDecode32(e), e;
837
857
  }, i && (n.MAX_VARINT64_BYTES = 10, n.calculateVarint64 = function(t) {
838
858
  typeof t == "number" ? t = i.fromNumber(t) : typeof t == "string" && (t = i.fromString(t));
839
- var e = t.toInt() >>> 0, r = t.shiftRightUnsigned(28).toInt() >>> 0, s = t.shiftRightUnsigned(56).toInt() >>> 0;
840
- return s == 0 ? r == 0 ? e < 16384 ? e < 128 ? 1 : 2 : e < 1 << 21 ? 3 : 4 : r < 16384 ? r < 128 ? 5 : 6 : r < 1 << 21 ? 7 : 8 : s < 128 ? 9 : 10;
859
+ var e = t.toInt() >>> 0, r = t.shiftRightUnsigned(28).toInt() >>> 0, a = t.shiftRightUnsigned(56).toInt() >>> 0;
860
+ return a == 0 ? r == 0 ? e < 16384 ? e < 128 ? 1 : 2 : e < 1 << 21 ? 3 : 4 : r < 16384 ? r < 128 ? 5 : 6 : r < 1 << 21 ? 7 : 8 : a < 128 ? 9 : 10;
841
861
  }, n.zigZagEncode64 = function(t) {
842
862
  return typeof t == "number" ? t = i.fromNumber(t, !1) : typeof t == "string" ? t = i.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()), t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned();
843
863
  }, n.zigZagDecode64 = function(t) {
844
864
  return typeof t == "number" ? t = i.fromNumber(t, !1) : typeof t == "string" ? t = i.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()), t.shiftRightUnsigned(1).xor(t.and(i.ONE).toSigned().negate()).toSigned();
845
- }, a.writeVarint64 = function(t, e) {
865
+ }, s.writeVarint64 = function(t, e) {
846
866
  var r = typeof e > "u";
847
867
  if (r && (e = this.offset), !this.noAssert) {
848
868
  if (typeof t == "number")
@@ -857,35 +877,35 @@ function pt() {
857
877
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
858
878
  }
859
879
  typeof t == "number" ? t = i.fromNumber(t, !1) : typeof t == "string" ? t = i.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
860
- var s = n.calculateVarint64(t), o = t.toInt() >>> 0, u = t.shiftRightUnsigned(28).toInt() >>> 0, l = t.shiftRightUnsigned(56).toInt() >>> 0;
861
- e += s;
880
+ var a = n.calculateVarint64(t), o = t.toInt() >>> 0, u = t.shiftRightUnsigned(28).toInt() >>> 0, l = t.shiftRightUnsigned(56).toInt() >>> 0;
881
+ e += a;
862
882
  var p = this.buffer.byteLength;
863
- switch (e > p && this.resize((p *= 2) > e ? p : e), e -= s, s) {
883
+ switch (e > p && this.resize((p *= 2) > e ? p : e), e -= a, a) {
864
884
  case 10:
865
885
  this.view[e + 9] = l >>> 7 & 1;
866
886
  case 9:
867
- this.view[e + 8] = s !== 9 ? l | 128 : l & 127;
887
+ this.view[e + 8] = a !== 9 ? l | 128 : l & 127;
868
888
  case 8:
869
- this.view[e + 7] = s !== 8 ? u >>> 21 | 128 : u >>> 21 & 127;
889
+ this.view[e + 7] = a !== 8 ? u >>> 21 | 128 : u >>> 21 & 127;
870
890
  case 7:
871
- this.view[e + 6] = s !== 7 ? u >>> 14 | 128 : u >>> 14 & 127;
891
+ this.view[e + 6] = a !== 7 ? u >>> 14 | 128 : u >>> 14 & 127;
872
892
  case 6:
873
- this.view[e + 5] = s !== 6 ? u >>> 7 | 128 : u >>> 7 & 127;
893
+ this.view[e + 5] = a !== 6 ? u >>> 7 | 128 : u >>> 7 & 127;
874
894
  case 5:
875
- this.view[e + 4] = s !== 5 ? u | 128 : u & 127;
895
+ this.view[e + 4] = a !== 5 ? u | 128 : u & 127;
876
896
  case 4:
877
- this.view[e + 3] = s !== 4 ? o >>> 21 | 128 : o >>> 21 & 127;
897
+ this.view[e + 3] = a !== 4 ? o >>> 21 | 128 : o >>> 21 & 127;
878
898
  case 3:
879
- this.view[e + 2] = s !== 3 ? o >>> 14 | 128 : o >>> 14 & 127;
899
+ this.view[e + 2] = a !== 3 ? o >>> 14 | 128 : o >>> 14 & 127;
880
900
  case 2:
881
- this.view[e + 1] = s !== 2 ? o >>> 7 | 128 : o >>> 7 & 127;
901
+ this.view[e + 1] = a !== 2 ? o >>> 7 | 128 : o >>> 7 & 127;
882
902
  case 1:
883
- this.view[e] = s !== 1 ? o | 128 : o & 127;
903
+ this.view[e] = a !== 1 ? o | 128 : o & 127;
884
904
  }
885
- return r ? (this.offset += s, this) : s;
886
- }, a.writeVarint64ZigZag = function(t, e) {
905
+ return r ? (this.offset += a, this) : a;
906
+ }, s.writeVarint64ZigZag = function(t, e) {
887
907
  return this.writeVarint64(n.zigZagEncode64(t), e);
888
- }, a.readVarint64 = function(t) {
908
+ }, s.readVarint64 = function(t) {
889
909
  var e = typeof t > "u";
890
910
  if (e && (t = this.offset), !this.noAssert) {
891
911
  if (typeof t != "number" || t % 1 !== 0)
@@ -893,38 +913,38 @@ function pt() {
893
913
  if (t >>>= 0, t < 0 || t + 1 > this.buffer.byteLength)
894
914
  throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength);
895
915
  }
896
- var r = t, s = 0, o = 0, u = 0, l = 0;
897
- if (l = this.view[t++], s = l & 127, l & 128 && (l = this.view[t++], s |= (l & 127) << 7, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], s |= (l & 127) << 14, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], s |= (l & 127) << 21, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o = l & 127, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 7, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 14, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 21, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], u = l & 127, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], u |= (l & 127) << 7, l & 128 || this.noAssert && typeof l > "u"))))))))))
916
+ var r = t, a = 0, o = 0, u = 0, l = 0;
917
+ if (l = this.view[t++], a = l & 127, l & 128 && (l = this.view[t++], a |= (l & 127) << 7, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], a |= (l & 127) << 14, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], a |= (l & 127) << 21, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o = l & 127, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 7, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 14, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], o |= (l & 127) << 21, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], u = l & 127, (l & 128 || this.noAssert && typeof l > "u") && (l = this.view[t++], u |= (l & 127) << 7, l & 128 || this.noAssert && typeof l > "u"))))))))))
898
918
  throw Error("Buffer overrun");
899
- var p = i.fromBits(s | o << 28, o >>> 4 | u << 24, !1);
919
+ var p = i.fromBits(a | o << 28, o >>> 4 | u << 24, !1);
900
920
  return e ? (this.offset = t, p) : {
901
921
  value: p,
902
922
  length: t - r
903
923
  };
904
- }, a.readVarint64ZigZag = function(t) {
924
+ }, s.readVarint64ZigZag = function(t) {
905
925
  var e = this.readVarint64(t);
906
926
  return e && e.value instanceof i ? e.value = n.zigZagDecode64(e.value) : e = n.zigZagDecode64(e), e;
907
- }), a.writeCString = function(t, e) {
927
+ }), s.writeCString = function(t, e) {
908
928
  var r = typeof e > "u";
909
929
  r && (e = this.offset);
910
- var s, o = t.length;
930
+ var a, o = t.length;
911
931
  if (!this.noAssert) {
912
932
  if (typeof t != "string")
913
933
  throw TypeError("Illegal str: Not a string");
914
- for (s = 0; s < o; ++s)
915
- if (t.charCodeAt(s) === 0)
934
+ for (a = 0; a < o; ++a)
935
+ if (t.charCodeAt(a) === 0)
916
936
  throw RangeError("Illegal str: Contains NULL-characters");
917
937
  if (typeof e != "number" || e % 1 !== 0)
918
938
  throw TypeError("Illegal offset: " + e + " (not an integer)");
919
939
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
920
940
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
921
941
  }
922
- o = m.calculateUTF16asUTF8(w(t))[1], e += o + 1;
942
+ o = v.calculateUTF16asUTF8(d(t))[1], e += o + 1;
923
943
  var u = this.buffer.byteLength;
924
- return e > u && this.resize((u *= 2) > e ? u : e), e -= o + 1, m.encodeUTF16toUTF8(w(t), (function(l) {
944
+ return e > u && this.resize((u *= 2) > e ? u : e), e -= o + 1, v.encodeUTF16toUTF8(d(t), (function(l) {
925
945
  this.view[e++] = l;
926
946
  }).bind(this)), this.view[e++] = 0, r ? (this.offset = e, this) : o;
927
- }, a.readCString = function(t) {
947
+ }, s.readCString = function(t) {
928
948
  var e = typeof t > "u";
929
949
  if (e && (t = this.offset), !this.noAssert) {
930
950
  if (typeof t != "number" || t % 1 !== 0)
@@ -932,17 +952,17 @@ function pt() {
932
952
  if (t >>>= 0, t < 0 || t + 1 > this.buffer.byteLength)
933
953
  throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength);
934
954
  }
935
- var r = t, s, o = -1;
936
- return m.decodeUTF8toUTF16((function() {
955
+ var r = t, a, o = -1;
956
+ return v.decodeUTF8toUTF16((function() {
937
957
  if (o === 0) return null;
938
958
  if (t >= this.limit)
939
959
  throw RangeError("Illegal range: Truncated data, " + t + " < " + this.limit);
940
960
  return o = this.view[t++], o === 0 ? null : o;
941
- }).bind(this), s = y(), !0), e ? (this.offset = t, s()) : {
942
- string: s(),
961
+ }).bind(this), a = E(), !0), e ? (this.offset = t, a()) : {
962
+ string: a(),
943
963
  length: t - r
944
964
  };
945
- }, a.writeIString = function(t, e) {
965
+ }, s.writeIString = function(t, e) {
946
966
  var r = typeof e > "u";
947
967
  if (r && (e = this.offset), !this.noAssert) {
948
968
  if (typeof t != "string")
@@ -952,15 +972,15 @@ function pt() {
952
972
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
953
973
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
954
974
  }
955
- var s = e, o;
956
- o = m.calculateUTF16asUTF8(w(t), this.noAssert)[1], e += 4 + o;
975
+ var a = e, o;
976
+ o = v.calculateUTF16asUTF8(d(t), this.noAssert)[1], e += 4 + o;
957
977
  var u = this.buffer.byteLength;
958
- if (e > u && this.resize((u *= 2) > e ? u : e), e -= 4 + o, this.littleEndian ? (this.view[e + 3] = o >>> 24 & 255, this.view[e + 2] = o >>> 16 & 255, this.view[e + 1] = o >>> 8 & 255, this.view[e] = o & 255) : (this.view[e] = o >>> 24 & 255, this.view[e + 1] = o >>> 16 & 255, this.view[e + 2] = o >>> 8 & 255, this.view[e + 3] = o & 255), e += 4, m.encodeUTF16toUTF8(w(t), (function(l) {
978
+ if (e > u && this.resize((u *= 2) > e ? u : e), e -= 4 + o, this.littleEndian ? (this.view[e + 3] = o >>> 24 & 255, this.view[e + 2] = o >>> 16 & 255, this.view[e + 1] = o >>> 8 & 255, this.view[e] = o & 255) : (this.view[e] = o >>> 24 & 255, this.view[e + 1] = o >>> 16 & 255, this.view[e + 2] = o >>> 8 & 255, this.view[e + 3] = o & 255), e += 4, v.encodeUTF16toUTF8(d(t), (function(l) {
959
979
  this.view[e++] = l;
960
- }).bind(this)), e !== s + 4 + o)
980
+ }).bind(this)), e !== a + 4 + o)
961
981
  throw RangeError("Illegal range: Truncated data, " + e + " == " + (e + 4 + o));
962
- return r ? (this.offset = e, this) : e - s;
963
- }, a.readIString = function(t) {
982
+ return r ? (this.offset = e, this) : e - a;
983
+ }, s.readIString = function(t) {
964
984
  var e = typeof t > "u";
965
985
  if (e && (t = this.offset), !this.noAssert) {
966
986
  if (typeof t != "number" || t % 1 !== 0)
@@ -968,12 +988,12 @@ function pt() {
968
988
  if (t >>>= 0, t < 0 || t + 4 > this.buffer.byteLength)
969
989
  throw RangeError("Illegal offset: 0 <= " + t + " (+4) <= " + this.buffer.byteLength);
970
990
  }
971
- var r = t, s = this.readUint32(t), o = this.readUTF8String(s, n.METRICS_BYTES, t += 4);
991
+ var r = t, a = this.readUint32(t), o = this.readUTF8String(a, n.METRICS_BYTES, t += 4);
972
992
  return t += o.length, e ? (this.offset = t, o.string) : {
973
993
  string: o.string,
974
994
  length: t - r
975
995
  };
976
- }, n.METRICS_CHARS = "c", n.METRICS_BYTES = "b", a.writeUTF8String = function(t, e) {
996
+ }, n.METRICS_CHARS = "c", n.METRICS_BYTES = "b", s.writeUTF8String = function(t, e) {
977
997
  var r = typeof e > "u";
978
998
  if (r && (e = this.offset), !this.noAssert) {
979
999
  if (typeof e != "number" || e % 1 !== 0)
@@ -981,20 +1001,20 @@ function pt() {
981
1001
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
982
1002
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
983
1003
  }
984
- var s, o = e;
985
- s = m.calculateUTF16asUTF8(w(t))[1], e += s;
1004
+ var a, o = e;
1005
+ a = v.calculateUTF16asUTF8(d(t))[1], e += a;
986
1006
  var u = this.buffer.byteLength;
987
- return e > u && this.resize((u *= 2) > e ? u : e), e -= s, m.encodeUTF16toUTF8(w(t), (function(l) {
1007
+ return e > u && this.resize((u *= 2) > e ? u : e), e -= a, v.encodeUTF16toUTF8(d(t), (function(l) {
988
1008
  this.view[e++] = l;
989
1009
  }).bind(this)), r ? (this.offset = e, this) : e - o;
990
- }, a.writeString = a.writeUTF8String, n.calculateUTF8Chars = function(t) {
991
- return m.calculateUTF16asUTF8(w(t))[0];
1010
+ }, s.writeString = s.writeUTF8String, n.calculateUTF8Chars = function(t) {
1011
+ return v.calculateUTF16asUTF8(d(t))[0];
992
1012
  }, n.calculateUTF8Bytes = function(t) {
993
- return m.calculateUTF16asUTF8(w(t))[1];
994
- }, n.calculateString = n.calculateUTF8Bytes, a.readUTF8String = function(t, e, r) {
1013
+ return v.calculateUTF16asUTF8(d(t))[1];
1014
+ }, n.calculateString = n.calculateUTF8Bytes, s.readUTF8String = function(t, e, r) {
995
1015
  typeof e == "number" && (r = e, e = void 0);
996
- var s = typeof r > "u";
997
- if (s && (r = this.offset), typeof e > "u" && (e = n.METRICS_CHARS), !this.noAssert) {
1016
+ var a = typeof r > "u";
1017
+ if (a && (r = this.offset), typeof e > "u" && (e = n.METRICS_CHARS), !this.noAssert) {
998
1018
  if (typeof t != "number" || t % 1 !== 0)
999
1019
  throw TypeError("Illegal length: " + t + " (not an integer)");
1000
1020
  if (t |= 0, typeof r != "number" || r % 1 !== 0)
@@ -1004,13 +1024,13 @@ function pt() {
1004
1024
  }
1005
1025
  var o = 0, u = r, l;
1006
1026
  if (e === n.METRICS_CHARS) {
1007
- if (l = y(), m.decodeUTF8((function() {
1027
+ if (l = E(), v.decodeUTF8((function() {
1008
1028
  return o < t && r < this.limit ? this.view[r++] : null;
1009
1029
  }).bind(this), function(F) {
1010
- ++o, m.UTF8toUTF16(F, l);
1030
+ ++o, v.UTF8toUTF16(F, l);
1011
1031
  }), o !== t)
1012
1032
  throw RangeError("Illegal range: Truncated data, " + o + " == " + t);
1013
- return s ? (this.offset = r, l()) : {
1033
+ return a ? (this.offset = r, l()) : {
1014
1034
  string: l(),
1015
1035
  length: r - u
1016
1036
  };
@@ -1022,17 +1042,17 @@ function pt() {
1022
1042
  throw RangeError("Illegal offset: 0 <= " + r + " (+" + t + ") <= " + this.buffer.byteLength);
1023
1043
  }
1024
1044
  var p = r + t;
1025
- if (m.decodeUTF8toUTF16((function() {
1045
+ if (v.decodeUTF8toUTF16((function() {
1026
1046
  return r < p ? this.view[r++] : null;
1027
- }).bind(this), l = y(), this.noAssert), r !== p)
1047
+ }).bind(this), l = E(), this.noAssert), r !== p)
1028
1048
  throw RangeError("Illegal range: Truncated data, " + r + " == " + p);
1029
- return s ? (this.offset = r, l()) : {
1049
+ return a ? (this.offset = r, l()) : {
1030
1050
  string: l(),
1031
1051
  length: r - u
1032
1052
  };
1033
1053
  } else
1034
1054
  throw TypeError("Unsupported metrics: " + e);
1035
- }, a.readString = a.readUTF8String, a.writeVString = function(t, e) {
1055
+ }, s.readString = s.readUTF8String, s.writeVString = function(t, e) {
1036
1056
  var r = typeof e > "u";
1037
1057
  if (r && (e = this.offset), !this.noAssert) {
1038
1058
  if (typeof t != "string")
@@ -1042,15 +1062,15 @@ function pt() {
1042
1062
  if (e >>>= 0, e < 0 || e + 0 > this.buffer.byteLength)
1043
1063
  throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength);
1044
1064
  }
1045
- var s = e, o, u;
1046
- o = m.calculateUTF16asUTF8(w(t), this.noAssert)[1], u = n.calculateVarint32(o), e += u + o;
1065
+ var a = e, o, u;
1066
+ o = v.calculateUTF16asUTF8(d(t), this.noAssert)[1], u = n.calculateVarint32(o), e += u + o;
1047
1067
  var l = this.buffer.byteLength;
1048
- if (e > l && this.resize((l *= 2) > e ? l : e), e -= u + o, e += this.writeVarint32(o, e), m.encodeUTF16toUTF8(w(t), (function(p) {
1068
+ if (e > l && this.resize((l *= 2) > e ? l : e), e -= u + o, e += this.writeVarint32(o, e), v.encodeUTF16toUTF8(d(t), (function(p) {
1049
1069
  this.view[e++] = p;
1050
- }).bind(this)), e !== s + o + u)
1070
+ }).bind(this)), e !== a + o + u)
1051
1071
  throw RangeError("Illegal range: Truncated data, " + e + " == " + (e + o + u));
1052
- return r ? (this.offset = e, this) : e - s;
1053
- }, a.readVString = function(t) {
1072
+ return r ? (this.offset = e, this) : e - a;
1073
+ }, s.readVString = function(t) {
1054
1074
  var e = typeof t > "u";
1055
1075
  if (e && (t = this.offset), !this.noAssert) {
1056
1076
  if (typeof t != "number" || t % 1 !== 0)
@@ -1058,15 +1078,15 @@ function pt() {
1058
1078
  if (t >>>= 0, t < 0 || t + 1 > this.buffer.byteLength)
1059
1079
  throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength);
1060
1080
  }
1061
- var r = t, s = this.readVarint32(t), o = this.readUTF8String(s.value, n.METRICS_BYTES, t += s.length);
1081
+ var r = t, a = this.readVarint32(t), o = this.readUTF8String(a.value, n.METRICS_BYTES, t += a.length);
1062
1082
  return t += o.length, e ? (this.offset = t, o.string) : {
1063
1083
  string: o.string,
1064
1084
  length: t - r
1065
1085
  };
1066
- }, a.append = function(t, e, r) {
1086
+ }, s.append = function(t, e, r) {
1067
1087
  (typeof e == "number" || typeof e != "string") && (r = e, e = void 0);
1068
- var s = typeof r > "u";
1069
- if (s && (r = this.offset), !this.noAssert) {
1088
+ var a = typeof r > "u";
1089
+ if (a && (r = this.offset), !this.noAssert) {
1070
1090
  if (typeof r != "number" || r % 1 !== 0)
1071
1091
  throw TypeError("Illegal offset: " + r + " (not an integer)");
1072
1092
  if (r >>>= 0, r < 0 || r + 0 > this.buffer.byteLength)
@@ -1077,19 +1097,19 @@ function pt() {
1077
1097
  if (o <= 0) return this;
1078
1098
  r += o;
1079
1099
  var u = this.buffer.byteLength;
1080
- return r > u && this.resize((u *= 2) > r ? u : r), r -= o, this.view.set(t.view.subarray(t.offset, t.limit), r), t.offset += o, s && (this.offset += o), this;
1081
- }, a.appendTo = function(t, e) {
1100
+ return r > u && this.resize((u *= 2) > r ? u : r), r -= o, this.view.set(t.view.subarray(t.offset, t.limit), r), t.offset += o, a && (this.offset += o), this;
1101
+ }, s.appendTo = function(t, e) {
1082
1102
  return t.append(this, e), this;
1083
- }, a.assert = function(t) {
1103
+ }, s.assert = function(t) {
1084
1104
  return this.noAssert = !t, this;
1085
- }, a.capacity = function() {
1105
+ }, s.capacity = function() {
1086
1106
  return this.buffer.byteLength;
1087
- }, a.clear = function() {
1107
+ }, s.clear = function() {
1088
1108
  return this.offset = 0, this.limit = this.buffer.byteLength, this.markedOffset = -1, this;
1089
- }, a.clone = function(t) {
1109
+ }, s.clone = function(t) {
1090
1110
  var e = new n(0, this.littleEndian, this.noAssert);
1091
1111
  return t ? (e.buffer = new ArrayBuffer(this.buffer.byteLength), e.view = new Uint8Array(e.buffer)) : (e.buffer = this.buffer, e.view = this.view), e.offset = this.offset, e.markedOffset = this.markedOffset, e.limit = this.limit, e;
1092
- }, a.compact = function(t, e) {
1112
+ }, s.compact = function(t, e) {
1093
1113
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), !this.noAssert) {
1094
1114
  if (typeof t != "number" || t % 1 !== 0)
1095
1115
  throw TypeError("Illegal begin: Not an integer");
@@ -1103,9 +1123,9 @@ function pt() {
1103
1123
  var r = e - t;
1104
1124
  if (r === 0)
1105
1125
  return this.buffer = c, this.view = null, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = 0, this;
1106
- var s = new ArrayBuffer(r), o = new Uint8Array(s);
1107
- return o.set(this.view.subarray(t, e)), this.buffer = s, this.view = o, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = r, this;
1108
- }, a.copy = function(t, e) {
1126
+ var a = new ArrayBuffer(r), o = new Uint8Array(a);
1127
+ return o.set(this.view.subarray(t, e)), this.buffer = a, this.view = o, this.markedOffset >= 0 && (this.markedOffset -= t), this.offset = 0, this.limit = r, this;
1128
+ }, s.copy = function(t, e) {
1109
1129
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), !this.noAssert) {
1110
1130
  if (typeof t != "number" || t % 1 !== 0)
1111
1131
  throw TypeError("Illegal begin: Not an integer");
@@ -1116,24 +1136,24 @@ function pt() {
1116
1136
  }
1117
1137
  if (t === e)
1118
1138
  return new n(0, this.littleEndian, this.noAssert);
1119
- var r = e - t, s = new n(r, this.littleEndian, this.noAssert);
1120
- return s.offset = 0, s.limit = r, s.markedOffset >= 0 && (s.markedOffset -= t), this.copyTo(s, 0, t, e), s;
1121
- }, a.copyTo = function(t, e, r, s) {
1139
+ var r = e - t, a = new n(r, this.littleEndian, this.noAssert);
1140
+ return a.offset = 0, a.limit = r, a.markedOffset >= 0 && (a.markedOffset -= t), this.copyTo(a, 0, t, e), a;
1141
+ }, s.copyTo = function(t, e, r, a) {
1122
1142
  var o, u;
1123
1143
  if (!this.noAssert && !n.isByteBuffer(t))
1124
1144
  throw TypeError("Illegal target: Not a ByteBuffer");
1125
- if (e = (u = typeof e > "u") ? t.offset : e | 0, r = (o = typeof r > "u") ? this.offset : r | 0, s = typeof s > "u" ? this.limit : s | 0, e < 0 || e > t.buffer.byteLength)
1145
+ if (e = (u = typeof e > "u") ? t.offset : e | 0, r = (o = typeof r > "u") ? this.offset : r | 0, a = typeof a > "u" ? this.limit : a | 0, e < 0 || e > t.buffer.byteLength)
1126
1146
  throw RangeError("Illegal target range: 0 <= " + e + " <= " + t.buffer.byteLength);
1127
- if (r < 0 || s > this.buffer.byteLength)
1147
+ if (r < 0 || a > this.buffer.byteLength)
1128
1148
  throw RangeError("Illegal source range: 0 <= " + r + " <= " + this.buffer.byteLength);
1129
- var l = s - r;
1130
- return l === 0 ? t : (t.ensureCapacity(e + l), t.view.set(this.view.subarray(r, s), e), o && (this.offset += l), u && (t.offset += l), this);
1131
- }, a.ensureCapacity = function(t) {
1149
+ var l = a - r;
1150
+ return l === 0 ? t : (t.ensureCapacity(e + l), t.view.set(this.view.subarray(r, a), e), o && (this.offset += l), u && (t.offset += l), this);
1151
+ }, s.ensureCapacity = function(t) {
1132
1152
  var e = this.buffer.byteLength;
1133
1153
  return e < t ? this.resize((e *= 2) > t ? e : t) : this;
1134
- }, a.fill = function(t, e, r) {
1135
- var s = typeof e > "u";
1136
- if (s && (e = this.offset), typeof t == "string" && t.length > 0 && (t = t.charCodeAt(0)), typeof e > "u" && (e = this.offset), typeof r > "u" && (r = this.limit), !this.noAssert) {
1154
+ }, s.fill = function(t, e, r) {
1155
+ var a = typeof e > "u";
1156
+ if (a && (e = this.offset), typeof t == "string" && t.length > 0 && (t = t.charCodeAt(0)), typeof e > "u" && (e = this.offset), typeof r > "u" && (r = this.limit), !this.noAssert) {
1137
1157
  if (typeof t != "number" || t % 1 !== 0)
1138
1158
  throw TypeError("Illegal value: " + t + " (not an integer)");
1139
1159
  if (t |= 0, typeof e != "number" || e % 1 !== 0)
@@ -1146,10 +1166,10 @@ function pt() {
1146
1166
  if (e >= r)
1147
1167
  return this;
1148
1168
  for (; e < r; ) this.view[e++] = t;
1149
- return s && (this.offset = e), this;
1150
- }, a.flip = function() {
1169
+ return a && (this.offset = e), this;
1170
+ }, s.flip = function() {
1151
1171
  return this.limit = this.offset, this.offset = 0, this;
1152
- }, a.mark = function(t) {
1172
+ }, s.mark = function(t) {
1153
1173
  if (t = typeof t > "u" ? this.offset : t, !this.noAssert) {
1154
1174
  if (typeof t != "number" || t % 1 !== 0)
1155
1175
  throw TypeError("Illegal offset: " + t + " (not an integer)");
@@ -1157,18 +1177,18 @@ function pt() {
1157
1177
  throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength);
1158
1178
  }
1159
1179
  return this.markedOffset = t, this;
1160
- }, a.order = function(t) {
1180
+ }, s.order = function(t) {
1161
1181
  if (!this.noAssert && typeof t != "boolean")
1162
1182
  throw TypeError("Illegal littleEndian: Not a boolean");
1163
1183
  return this.littleEndian = !!t, this;
1164
- }, a.LE = function(t) {
1184
+ }, s.LE = function(t) {
1165
1185
  return this.littleEndian = typeof t < "u" ? !!t : !0, this;
1166
- }, a.BE = function(t) {
1186
+ }, s.BE = function(t) {
1167
1187
  return this.littleEndian = typeof t < "u" ? !t : !1, this;
1168
- }, a.prepend = function(t, e, r) {
1188
+ }, s.prepend = function(t, e, r) {
1169
1189
  (typeof e == "number" || typeof e != "string") && (r = e, e = void 0);
1170
- var s = typeof r > "u";
1171
- if (s && (r = this.offset), !this.noAssert) {
1190
+ var a = typeof r > "u";
1191
+ if (a && (r = this.offset), !this.noAssert) {
1172
1192
  if (typeof r != "number" || r % 1 !== 0)
1173
1193
  throw TypeError("Illegal offset: " + r + " (not an integer)");
1174
1194
  if (r >>>= 0, r < 0 || r + 0 > this.buffer.byteLength)
@@ -1183,10 +1203,10 @@ function pt() {
1183
1203
  p.set(this.view.subarray(r, this.buffer.byteLength), o), this.buffer = l, this.view = p, this.offset += u, this.markedOffset >= 0 && (this.markedOffset += u), this.limit += u, r += u;
1184
1204
  } else
1185
1205
  new Uint8Array(this.buffer);
1186
- return this.view.set(t.view.subarray(t.offset, t.limit), r - o), t.offset = t.limit, s && (this.offset -= o), this;
1187
- }, a.prependTo = function(t, e) {
1206
+ return this.view.set(t.view.subarray(t.offset, t.limit), r - o), t.offset = t.limit, a && (this.offset -= o), this;
1207
+ }, s.prependTo = function(t, e) {
1188
1208
  return t.prepend(this, e), this;
1189
- }, a.printDebug = function(t) {
1209
+ }, s.printDebug = function(t) {
1190
1210
  typeof t != "function" && (t = console.log.bind(console)), t(
1191
1211
  this.toString() + `
1192
1212
  -------------------------------------------------------------------
@@ -1195,11 +1215,11 @@ function pt() {
1195
1215
  !0
1196
1216
  )
1197
1217
  );
1198
- }, a.remaining = function() {
1218
+ }, s.remaining = function() {
1199
1219
  return this.limit - this.offset;
1200
- }, a.reset = function() {
1220
+ }, s.reset = function() {
1201
1221
  return this.markedOffset >= 0 ? (this.offset = this.markedOffset, this.markedOffset = -1) : this.offset = 0, this;
1202
- }, a.resize = function(t) {
1222
+ }, s.resize = function(t) {
1203
1223
  if (!this.noAssert) {
1204
1224
  if (typeof t != "number" || t % 1 !== 0)
1205
1225
  throw TypeError("Illegal capacity: " + t + " (not an integer)");
@@ -1211,7 +1231,7 @@ function pt() {
1211
1231
  r.set(this.view), this.buffer = e, this.view = r;
1212
1232
  }
1213
1233
  return this;
1214
- }, a.reverse = function(t, e) {
1234
+ }, s.reverse = function(t, e) {
1215
1235
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), !this.noAssert) {
1216
1236
  if (typeof t != "number" || t % 1 !== 0)
1217
1237
  throw TypeError("Illegal begin: Not an integer");
@@ -1221,7 +1241,7 @@ function pt() {
1221
1241
  throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength);
1222
1242
  }
1223
1243
  return t === e ? this : (Array.prototype.reverse.call(this.view.subarray(t, e)), this);
1224
- }, a.skip = function(t) {
1244
+ }, s.skip = function(t) {
1225
1245
  if (!this.noAssert) {
1226
1246
  if (typeof t != "number" || t % 1 !== 0)
1227
1247
  throw TypeError("Illegal length: " + t + " (not an integer)");
@@ -1231,7 +1251,7 @@ function pt() {
1231
1251
  if (!this.noAssert && (e < 0 || e > this.buffer.byteLength))
1232
1252
  throw RangeError("Illegal length: 0 <= " + this.offset + " + " + t + " <= " + this.buffer.byteLength);
1233
1253
  return this.offset = e, this;
1234
- }, a.slice = function(t, e) {
1254
+ }, s.slice = function(t, e) {
1235
1255
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), !this.noAssert) {
1236
1256
  if (typeof t != "number" || t % 1 !== 0)
1237
1257
  throw TypeError("Illegal begin: Not an integer");
@@ -1242,7 +1262,7 @@ function pt() {
1242
1262
  }
1243
1263
  var r = this.clone();
1244
1264
  return r.offset = t, r.limit = e, r;
1245
- }, a.toBuffer = function(t) {
1265
+ }, s.toBuffer = function(t) {
1246
1266
  var e = this.offset, r = this.limit;
1247
1267
  if (!this.noAssert) {
1248
1268
  if (typeof e != "number" || e % 1 !== 0)
@@ -1256,9 +1276,9 @@ function pt() {
1256
1276
  return this.buffer;
1257
1277
  if (e === r)
1258
1278
  return c;
1259
- var s = new ArrayBuffer(r - e);
1260
- return new Uint8Array(s).set(new Uint8Array(this.buffer).subarray(e, r), 0), s;
1261
- }, a.toArrayBuffer = a.toBuffer, a.toString = function(t, e, r) {
1279
+ var a = new ArrayBuffer(r - e);
1280
+ return new Uint8Array(a).set(new Uint8Array(this.buffer).subarray(e, r), 0), a;
1281
+ }, s.toArrayBuffer = s.toBuffer, s.toString = function(t, e, r) {
1262
1282
  if (typeof t > "u")
1263
1283
  return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
1264
1284
  switch (typeof t == "number" && (t = "utf8", e = t, r = e), t) {
@@ -1278,7 +1298,7 @@ function pt() {
1278
1298
  throw Error("Unsupported encoding: " + t);
1279
1299
  }
1280
1300
  };
1281
- var T = function() {
1301
+ var I = function() {
1282
1302
  for (var t = {}, e = [
1283
1303
  65,
1284
1304
  66,
@@ -1344,26 +1364,26 @@ function pt() {
1344
1364
  57,
1345
1365
  43,
1346
1366
  47
1347
- ], r = [], s = 0, o = e.length; s < o; ++s)
1348
- r[e[s]] = s;
1367
+ ], r = [], a = 0, o = e.length; a < o; ++a)
1368
+ r[e[a]] = a;
1349
1369
  return t.encode = function(u, l) {
1350
1370
  for (var p, F; (p = u()) !== null; )
1351
1371
  l(e[p >> 2 & 63]), F = (p & 3) << 4, (p = u()) !== null ? (F |= p >> 4 & 15, l(e[(F | p >> 4 & 15) & 63]), F = (p & 15) << 2, (p = u()) !== null ? (l(e[(F | p >> 6 & 3) & 63]), l(e[p & 63])) : (l(e[F & 63]), l(61))) : (l(e[F & 63]), l(61), l(61));
1352
1372
  }, t.decode = function(u, l) {
1353
1373
  var p, F, S;
1354
- function A(L) {
1355
- throw Error("Illegal character code: " + L);
1374
+ function N(_) {
1375
+ throw Error("Illegal character code: " + _);
1356
1376
  }
1357
1377
  for (; (p = u()) !== null; )
1358
- if (F = r[p], typeof F > "u" && A(p), (p = u()) !== null && (S = r[p], typeof S > "u" && A(p), l(F << 2 >>> 0 | (S & 48) >> 4), (p = u()) !== null)) {
1378
+ if (F = r[p], typeof F > "u" && N(p), (p = u()) !== null && (S = r[p], typeof S > "u" && N(p), l(F << 2 >>> 0 | (S & 48) >> 4), (p = u()) !== null)) {
1359
1379
  if (F = r[p], typeof F > "u") {
1360
1380
  if (p === 61) break;
1361
- A(p);
1381
+ N(p);
1362
1382
  }
1363
1383
  if (l((S & 15) << 4 >>> 0 | (F & 60) >> 2), (p = u()) !== null) {
1364
1384
  if (S = r[p], typeof S > "u") {
1365
1385
  if (p === 61) break;
1366
- A(p);
1386
+ N(p);
1367
1387
  }
1368
1388
  l((F & 3) << 6 >>> 0 | S);
1369
1389
  }
@@ -1372,44 +1392,44 @@ function pt() {
1372
1392
  return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u);
1373
1393
  }, t;
1374
1394
  }();
1375
- a.toBase64 = function(t, e) {
1395
+ s.toBase64 = function(t, e) {
1376
1396
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), t = t | 0, e = e | 0, t < 0 || e > this.capacity || t > e)
1377
1397
  throw RangeError("begin, end");
1378
1398
  var r;
1379
- return T.encode((function() {
1399
+ return I.encode((function() {
1380
1400
  return t < e ? this.view[t++] : null;
1381
- }).bind(this), r = y()), r();
1401
+ }).bind(this), r = E()), r();
1382
1402
  }, n.fromBase64 = function(t, e) {
1383
1403
  if (typeof t != "string")
1384
1404
  throw TypeError("str");
1385
- var r = new n(t.length / 4 * 3, e), s = 0;
1386
- return T.decode(w(t), function(o) {
1387
- r.view[s++] = o;
1388
- }), r.limit = s, r;
1405
+ var r = new n(t.length / 4 * 3, e), a = 0;
1406
+ return I.decode(d(t), function(o) {
1407
+ r.view[a++] = o;
1408
+ }), r.limit = a, r;
1389
1409
  }, n.btoa = function(t) {
1390
1410
  return n.fromBinary(t).toBase64();
1391
1411
  }, n.atob = function(t) {
1392
1412
  return n.fromBase64(t).toBinary();
1393
- }, a.toBinary = function(t, e) {
1413
+ }, s.toBinary = function(t, e) {
1394
1414
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), t |= 0, e |= 0, t < 0 || e > this.capacity() || t > e)
1395
1415
  throw RangeError("begin, end");
1396
1416
  if (t === e)
1397
1417
  return "";
1398
- for (var r = [], s = []; t < e; )
1399
- r.push(this.view[t++]), r.length >= 1024 && (s.push(String.fromCharCode.apply(String, r)), r = []);
1400
- return s.join("") + String.fromCharCode.apply(String, r);
1418
+ for (var r = [], a = []; t < e; )
1419
+ r.push(this.view[t++]), r.length >= 1024 && (a.push(String.fromCharCode.apply(String, r)), r = []);
1420
+ return a.join("") + String.fromCharCode.apply(String, r);
1401
1421
  }, n.fromBinary = function(t, e) {
1402
1422
  if (typeof t != "string")
1403
1423
  throw TypeError("str");
1404
- for (var r = 0, s = t.length, o, u = new n(s, e); r < s; ) {
1424
+ for (var r = 0, a = t.length, o, u = new n(a, e); r < a; ) {
1405
1425
  if (o = t.charCodeAt(r), o > 255)
1406
1426
  throw RangeError("illegal char code: " + o);
1407
1427
  u.view[r++] = o;
1408
1428
  }
1409
- return u.limit = s, u;
1410
- }, a.toDebug = function(t) {
1411
- for (var e = -1, r = this.buffer.byteLength, s, o = "", u = "", l = ""; e < r; ) {
1412
- if (e !== -1 && (s = this.view[e], s < 16 ? o += "0" + s.toString(16).toUpperCase() : o += s.toString(16).toUpperCase(), t && (u += s > 32 && s < 127 ? String.fromCharCode(s) : ".")), ++e, t && e > 0 && e % 16 === 0 && e !== r) {
1429
+ return u.limit = a, u;
1430
+ }, s.toDebug = function(t) {
1431
+ for (var e = -1, r = this.buffer.byteLength, a, o = "", u = "", l = ""; e < r; ) {
1432
+ if (e !== -1 && (a = this.view[e], a < 16 ? o += "0" + a.toString(16).toUpperCase() : o += a.toString(16).toUpperCase(), t && (u += a > 32 && a < 127 ? String.fromCharCode(a) : ".")), ++e, t && e > 0 && e % 16 === 0 && e !== r) {
1413
1433
  for (; o.length < 3 * 16 + 3; ) o += " ";
1414
1434
  l += o + u + `
1415
1435
  `, o = u = "";
@@ -1424,75 +1444,75 @@ function pt() {
1424
1444
  }
1425
1445
  return t ? l : o;
1426
1446
  }, n.fromDebug = function(t, e, r) {
1427
- for (var s = t.length, o = new n((s + 1) / 3 | 0, e, r), u = 0, l = 0, p, F, S = !1, A = !1, L = !1, _ = !1, d = !1; u < s; ) {
1447
+ for (var a = t.length, o = new n((a + 1) / 3 | 0, e, r), u = 0, l = 0, p, F, S = !1, N = !1, _ = !1, L = !1, y = !1; u < a; ) {
1428
1448
  switch (p = t.charAt(u++)) {
1429
1449
  case "!":
1430
1450
  if (!r) {
1431
- if (A || L || _) {
1432
- d = !0;
1451
+ if (N || _ || L) {
1452
+ y = !0;
1433
1453
  break;
1434
1454
  }
1435
- A = L = _ = !0;
1455
+ N = _ = L = !0;
1436
1456
  }
1437
1457
  o.offset = o.markedOffset = o.limit = l, S = !1;
1438
1458
  break;
1439
1459
  case "|":
1440
1460
  if (!r) {
1441
- if (A || _) {
1442
- d = !0;
1461
+ if (N || L) {
1462
+ y = !0;
1443
1463
  break;
1444
1464
  }
1445
- A = _ = !0;
1465
+ N = L = !0;
1446
1466
  }
1447
1467
  o.offset = o.limit = l, S = !1;
1448
1468
  break;
1449
1469
  case "[":
1450
1470
  if (!r) {
1451
- if (A || L) {
1452
- d = !0;
1471
+ if (N || _) {
1472
+ y = !0;
1453
1473
  break;
1454
1474
  }
1455
- A = L = !0;
1475
+ N = _ = !0;
1456
1476
  }
1457
1477
  o.offset = o.markedOffset = l, S = !1;
1458
1478
  break;
1459
1479
  case "<":
1460
1480
  if (!r) {
1461
- if (A) {
1462
- d = !0;
1481
+ if (N) {
1482
+ y = !0;
1463
1483
  break;
1464
1484
  }
1465
- A = !0;
1485
+ N = !0;
1466
1486
  }
1467
1487
  o.offset = l, S = !1;
1468
1488
  break;
1469
1489
  case "]":
1470
1490
  if (!r) {
1471
- if (_ || L) {
1472
- d = !0;
1491
+ if (L || _) {
1492
+ y = !0;
1473
1493
  break;
1474
1494
  }
1475
- _ = L = !0;
1495
+ L = _ = !0;
1476
1496
  }
1477
1497
  o.limit = o.markedOffset = l, S = !1;
1478
1498
  break;
1479
1499
  case ">":
1480
1500
  if (!r) {
1481
- if (_) {
1482
- d = !0;
1501
+ if (L) {
1502
+ y = !0;
1483
1503
  break;
1484
1504
  }
1485
- _ = !0;
1505
+ L = !0;
1486
1506
  }
1487
1507
  o.limit = l, S = !1;
1488
1508
  break;
1489
1509
  case "'":
1490
1510
  if (!r) {
1491
- if (L) {
1492
- d = !0;
1511
+ if (_) {
1512
+ y = !0;
1493
1513
  break;
1494
1514
  }
1495
- L = !0;
1515
+ _ = !0;
1496
1516
  }
1497
1517
  o.markedOffset = l, S = !1;
1498
1518
  break;
@@ -1501,24 +1521,24 @@ function pt() {
1501
1521
  break;
1502
1522
  default:
1503
1523
  if (!r && S) {
1504
- d = !0;
1524
+ y = !0;
1505
1525
  break;
1506
1526
  }
1507
1527
  if (F = parseInt(p + t.charAt(u++), 16), !r && (isNaN(F) || F < 0 || F > 255))
1508
1528
  throw TypeError("Illegal str: Not a debug encoded string");
1509
1529
  o.view[l++] = F, S = !0;
1510
1530
  }
1511
- if (d)
1531
+ if (y)
1512
1532
  throw TypeError("Illegal str: Invalid symbol at " + u);
1513
1533
  }
1514
1534
  if (!r) {
1515
- if (!A || !_)
1535
+ if (!N || !L)
1516
1536
  throw TypeError("Illegal str: Missing offset or limit");
1517
1537
  if (l < o.buffer.byteLength)
1518
- throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + s);
1538
+ throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + a);
1519
1539
  }
1520
1540
  return o;
1521
- }, a.toHex = function(t, e) {
1541
+ }, s.toHex = function(t, e) {
1522
1542
  if (t = typeof t > "u" ? this.offset : t, e = typeof e > "u" ? this.limit : e, !this.noAssert) {
1523
1543
  if (typeof t != "number" || t % 1 !== 0)
1524
1544
  throw TypeError("Illegal begin: Not an integer");
@@ -1527,8 +1547,8 @@ function pt() {
1527
1547
  if (e >>>= 0, t < 0 || t > e || e > this.buffer.byteLength)
1528
1548
  throw RangeError("Illegal range: 0 <= " + t + " <= " + e + " <= " + this.buffer.byteLength);
1529
1549
  }
1530
- for (var r = new Array(e - t), s; t < e; )
1531
- s = this.view[t++], s < 16 ? r.push("0", s.toString(16)) : r.push(s.toString(16));
1550
+ for (var r = new Array(e - t), a; t < e; )
1551
+ a = this.view[t++], a < 16 ? r.push("0", a.toString(16)) : r.push(a.toString(16));
1532
1552
  return r.join("");
1533
1553
  }, n.fromHex = function(t, e, r) {
1534
1554
  if (!r) {
@@ -1537,73 +1557,73 @@ function pt() {
1537
1557
  if (t.length % 2 !== 0)
1538
1558
  throw TypeError("Illegal str: Length not a multiple of 2");
1539
1559
  }
1540
- for (var s = t.length, o = new n(s / 2 | 0, e), u, l = 0, p = 0; l < s; l += 2) {
1560
+ for (var a = t.length, o = new n(a / 2 | 0, e), u, l = 0, p = 0; l < a; l += 2) {
1541
1561
  if (u = parseInt(t.substring(l, l + 2), 16), !r && (!isFinite(u) || u < 0 || u > 255))
1542
1562
  throw TypeError("Illegal str: Contains non-hex characters");
1543
1563
  o.view[p++] = u;
1544
1564
  }
1545
1565
  return o.limit = p, o;
1546
1566
  };
1547
- var m = function() {
1567
+ var v = function() {
1548
1568
  var t = {};
1549
1569
  return t.MAX_CODEPOINT = 1114111, t.encodeUTF8 = function(e, r) {
1550
- var s = null;
1551
- for (typeof e == "number" && (s = e, e = function() {
1570
+ var a = null;
1571
+ for (typeof e == "number" && (a = e, e = function() {
1552
1572
  return null;
1553
- }); s !== null || (s = e()) !== null; )
1554
- s < 128 ? r(s & 127) : s < 2048 ? (r(s >> 6 & 31 | 192), r(s & 63 | 128)) : s < 65536 ? (r(s >> 12 & 15 | 224), r(s >> 6 & 63 | 128), r(s & 63 | 128)) : (r(s >> 18 & 7 | 240), r(s >> 12 & 63 | 128), r(s >> 6 & 63 | 128), r(s & 63 | 128)), s = null;
1573
+ }); a !== null || (a = e()) !== null; )
1574
+ a < 128 ? r(a & 127) : a < 2048 ? (r(a >> 6 & 31 | 192), r(a & 63 | 128)) : a < 65536 ? (r(a >> 12 & 15 | 224), r(a >> 6 & 63 | 128), r(a & 63 | 128)) : (r(a >> 18 & 7 | 240), r(a >> 12 & 63 | 128), r(a >> 6 & 63 | 128), r(a & 63 | 128)), a = null;
1555
1575
  }, t.decodeUTF8 = function(e, r) {
1556
- for (var s, o, u, l, p = function(F) {
1576
+ for (var a, o, u, l, p = function(F) {
1557
1577
  F = F.slice(0, F.indexOf(null));
1558
1578
  var S = Error(F.toString());
1559
1579
  throw S.name = "TruncatedError", S.bytes = F, S;
1560
- }; (s = e()) !== null; )
1561
- if ((s & 128) === 0)
1562
- r(s);
1563
- else if ((s & 224) === 192)
1564
- (o = e()) === null && p([s, o]), r((s & 31) << 6 | o & 63);
1565
- else if ((s & 240) === 224)
1566
- ((o = e()) === null || (u = e()) === null) && p([s, o, u]), r((s & 15) << 12 | (o & 63) << 6 | u & 63);
1567
- else if ((s & 248) === 240)
1568
- ((o = e()) === null || (u = e()) === null || (l = e()) === null) && p([s, o, u, l]), r((s & 7) << 18 | (o & 63) << 12 | (u & 63) << 6 | l & 63);
1569
- else throw RangeError("Illegal starting byte: " + s);
1580
+ }; (a = e()) !== null; )
1581
+ if ((a & 128) === 0)
1582
+ r(a);
1583
+ else if ((a & 224) === 192)
1584
+ (o = e()) === null && p([a, o]), r((a & 31) << 6 | o & 63);
1585
+ else if ((a & 240) === 224)
1586
+ ((o = e()) === null || (u = e()) === null) && p([a, o, u]), r((a & 15) << 12 | (o & 63) << 6 | u & 63);
1587
+ else if ((a & 248) === 240)
1588
+ ((o = e()) === null || (u = e()) === null || (l = e()) === null) && p([a, o, u, l]), r((a & 7) << 18 | (o & 63) << 12 | (u & 63) << 6 | l & 63);
1589
+ else throw RangeError("Illegal starting byte: " + a);
1570
1590
  }, t.UTF16toUTF8 = function(e, r) {
1571
- for (var s, o = null; (s = o !== null ? o : e()) !== null; ) {
1572
- if (s >= 55296 && s <= 57343 && (o = e()) !== null && o >= 56320 && o <= 57343) {
1573
- r((s - 55296) * 1024 + o - 56320 + 65536), o = null;
1591
+ for (var a, o = null; (a = o !== null ? o : e()) !== null; ) {
1592
+ if (a >= 55296 && a <= 57343 && (o = e()) !== null && o >= 56320 && o <= 57343) {
1593
+ r((a - 55296) * 1024 + o - 56320 + 65536), o = null;
1574
1594
  continue;
1575
1595
  }
1576
- r(s);
1596
+ r(a);
1577
1597
  }
1578
1598
  o !== null && r(o);
1579
1599
  }, t.UTF8toUTF16 = function(e, r) {
1580
- var s = null;
1581
- for (typeof e == "number" && (s = e, e = function() {
1600
+ var a = null;
1601
+ for (typeof e == "number" && (a = e, e = function() {
1582
1602
  return null;
1583
- }); s !== null || (s = e()) !== null; )
1584
- s <= 65535 ? r(s) : (s -= 65536, r((s >> 10) + 55296), r(s % 1024 + 56320)), s = null;
1603
+ }); a !== null || (a = e()) !== null; )
1604
+ a <= 65535 ? r(a) : (a -= 65536, r((a >> 10) + 55296), r(a % 1024 + 56320)), a = null;
1585
1605
  }, t.encodeUTF16toUTF8 = function(e, r) {
1586
- t.UTF16toUTF8(e, function(s) {
1587
- t.encodeUTF8(s, r);
1606
+ t.UTF16toUTF8(e, function(a) {
1607
+ t.encodeUTF8(a, r);
1588
1608
  });
1589
1609
  }, t.decodeUTF8toUTF16 = function(e, r) {
1590
- t.decodeUTF8(e, function(s) {
1591
- t.UTF8toUTF16(s, r);
1610
+ t.decodeUTF8(e, function(a) {
1611
+ t.UTF8toUTF16(a, r);
1592
1612
  });
1593
1613
  }, t.calculateCodePoint = function(e) {
1594
1614
  return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
1595
1615
  }, t.calculateUTF8 = function(e) {
1596
- for (var r, s = 0; (r = e()) !== null; )
1597
- s += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
1598
- return s;
1616
+ for (var r, a = 0; (r = e()) !== null; )
1617
+ a += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
1618
+ return a;
1599
1619
  }, t.calculateUTF16asUTF8 = function(e) {
1600
- var r = 0, s = 0;
1620
+ var r = 0, a = 0;
1601
1621
  return t.UTF16toUTF8(e, function(o) {
1602
- ++r, s += o < 128 ? 1 : o < 2048 ? 2 : o < 65536 ? 3 : 4;
1603
- }), [r, s];
1622
+ ++r, a += o < 128 ? 1 : o < 2048 ? 2 : o < 65536 ? 3 : 4;
1623
+ }), [r, a];
1604
1624
  }, t;
1605
1625
  }();
1606
- return a.toUTF8 = function(t, e) {
1626
+ return s.toUTF8 = function(t, e) {
1607
1627
  if (typeof t > "u" && (t = this.offset), typeof e > "u" && (e = this.limit), !this.noAssert) {
1608
1628
  if (typeof t != "number" || t % 1 !== 0)
1609
1629
  throw TypeError("Illegal begin: Not an integer");
@@ -1614,9 +1634,9 @@ function pt() {
1614
1634
  }
1615
1635
  var r;
1616
1636
  try {
1617
- m.decodeUTF8toUTF16((function() {
1637
+ v.decodeUTF8toUTF16((function() {
1618
1638
  return t < e ? this.view[t++] : null;
1619
- }).bind(this), r = y());
1639
+ }).bind(this), r = E());
1620
1640
  } catch {
1621
1641
  if (t !== e)
1622
1642
  throw RangeError("Illegal range: Truncated data, " + t + " != " + e);
@@ -1625,16 +1645,16 @@ function pt() {
1625
1645
  }, n.fromUTF8 = function(t, e, r) {
1626
1646
  if (!r && typeof t != "string")
1627
1647
  throw TypeError("Illegal str: Not a string");
1628
- var s = new n(m.calculateUTF16asUTF8(w(t), !0)[1], e, r), o = 0;
1629
- return m.encodeUTF16toUTF8(w(t), function(u) {
1630
- s.view[o++] = u;
1631
- }), s.limit = o, s;
1648
+ var a = new n(v.calculateUTF16asUTF8(d(t), !0)[1], e, r), o = 0;
1649
+ return v.encodeUTF16toUTF8(d(t), function(u) {
1650
+ a.view[o++] = u;
1651
+ }), a.limit = o, a;
1632
1652
  }, n;
1633
1653
  });
1634
- }(W)), W.exports;
1654
+ }(K)), K.exports;
1635
1655
  }
1636
- var dt = pt();
1637
- const q = /* @__PURE__ */ lt(dt), yt = 1, wt = 2, bt = 512, Et = 513, Ft = 514, Tt = 1, vt = 3;
1656
+ var Ft = Et();
1657
+ const q = /* @__PURE__ */ dt(Ft), Tt = 1, It = 2, vt = 512, mt = 513, xt = 514, St = 1, Ut = 3;
1638
1658
  class H {
1639
1659
  // 实例属性的类型标注
1640
1660
  valueStringPool;
@@ -1655,10 +1675,10 @@ class H {
1655
1675
  * @returns {ByteBuffer}
1656
1676
  */
1657
1677
  static readBytes(i, n) {
1658
- const a = new Uint8Array(n);
1678
+ const s = new Uint8Array(n);
1659
1679
  for (let c = 0; c < n; c++)
1660
- a[c] = i.readUint8();
1661
- return q.wrap(a, "binary", !0);
1680
+ s[c] = i.readUint8();
1681
+ return q.wrap(s, "binary", !0);
1662
1682
  }
1663
1683
  /**
1664
1684
  *
@@ -1666,33 +1686,33 @@ class H {
1666
1686
  * @return {Record<string, string[]>}
1667
1687
  */
1668
1688
  processResourceTable(i) {
1669
- const n = q.wrap(i, "binary", !0), a = n.readShort(), c = n.readShort(), E = n.readInt(), w = n.readInt();
1670
- let y, I;
1671
- if (a !== wt)
1689
+ const n = q.wrap(i, "binary", !0), s = n.readShort(), c = n.readShort(), w = n.readInt(), d = n.readInt();
1690
+ let E, T;
1691
+ if (s !== It)
1672
1692
  throw new Error("No RES_TABLE_TYPE found!");
1673
- if (E !== n.limit)
1693
+ if (w !== n.limit)
1674
1694
  throw new Error("The buffer size not matches to the resource table size.");
1675
1695
  n.offset = c;
1676
- let N = 0, T = 0;
1696
+ let U = 0, I = 0;
1677
1697
  for (; ; ) {
1678
- let m, t, e;
1698
+ let v, t, e;
1679
1699
  try {
1680
- m = n.offset, t = n.readShort(), n.readShort(), e = n.readInt();
1700
+ v = n.offset, t = n.readShort(), n.readShort(), e = n.readInt();
1681
1701
  } catch {
1682
1702
  break;
1683
1703
  }
1684
- if (t === yt)
1685
- N === 0 && (y = new q(e), n.offset = m, n.prependTo(y), I = q.wrap(y, "binary", !0), I.LE(), this.valueStringPool = this.processStringPool(I)), N++;
1686
- else if (t === bt)
1687
- y = new q(e), n.offset = m, n.prependTo(y), I = q.wrap(y, "binary", !0), I.LE(), this.processPackage(I), T++;
1704
+ if (t === Tt)
1705
+ U === 0 && (E = new q(e), n.offset = v, n.prependTo(E), T = q.wrap(E, "binary", !0), T.LE(), this.valueStringPool = this.processStringPool(T)), U++;
1706
+ else if (t === vt)
1707
+ E = new q(e), n.offset = v, n.prependTo(E), T = q.wrap(E, "binary", !0), T.LE(), this.processPackage(T), I++;
1688
1708
  else
1689
1709
  throw new Error("Unsupported type");
1690
- if (n.offset = m + e, !n.remaining())
1710
+ if (n.offset = v + e, !n.remaining())
1691
1711
  break;
1692
1712
  }
1693
- if (N !== 1)
1713
+ if (U !== 1)
1694
1714
  throw new Error("More than 1 string pool found!");
1695
- if (T !== w)
1715
+ if (I !== d)
1696
1716
  throw new Error("Real package count not equals the declared count.");
1697
1717
  return this.responseMap;
1698
1718
  }
@@ -1704,33 +1724,33 @@ class H {
1704
1724
  i.readShort();
1705
1725
  const n = i.readShort();
1706
1726
  i.readInt();
1707
- const a = i.readInt();
1708
- this.package_id = a;
1709
- for (let m = 0; m < 256; ++m)
1727
+ const s = i.readInt();
1728
+ this.package_id = s;
1729
+ for (let v = 0; v < 256; ++v)
1710
1730
  i.readUint8();
1711
1731
  const c = i.readInt();
1712
1732
  i.readInt();
1713
- const E = i.readInt();
1733
+ const w = i.readInt();
1714
1734
  if (i.readInt(), c !== n)
1715
1735
  throw new Error("TypeStrings must immediately following the package structure header.");
1716
- let w = i.offset;
1736
+ let d = i.offset;
1717
1737
  i.offset = c;
1718
- const y = H.readBytes(i, i.limit - i.offset);
1719
- i.offset = w, this.typeStringPool = this.processStringPool(y), i.offset = E, i.readShort(), i.readShort();
1720
- const I = i.readInt();
1721
- w = i.offset, i.offset = E;
1722
- const N = H.readBytes(i, i.limit - i.offset);
1723
- i.offset = w, this.keyStringPool = this.processStringPool(N), i.offset = E + I;
1724
- let T;
1738
+ const E = H.readBytes(i, i.limit - i.offset);
1739
+ i.offset = d, this.typeStringPool = this.processStringPool(E), i.offset = w, i.readShort(), i.readShort();
1740
+ const T = i.readInt();
1741
+ d = i.offset, i.offset = w;
1742
+ const U = H.readBytes(i, i.limit - i.offset);
1743
+ i.offset = d, this.keyStringPool = this.processStringPool(U), i.offset = w + T;
1744
+ let I;
1725
1745
  for (; ; ) {
1726
- const m = i.offset;
1746
+ const v = i.offset;
1727
1747
  let t, e;
1728
1748
  try {
1729
1749
  t = i.readShort(), i.readShort(), e = i.readInt();
1730
1750
  } catch {
1731
1751
  break;
1732
1752
  }
1733
- if (t === Ft ? (i.offset = m, T = H.readBytes(i, e), this.processTypeSpec(T)) : t === Et && (i.offset = m, T = H.readBytes(i, e), this.processType(T)), e === 0 || (i.offset = m + e, !i.remaining()))
1753
+ if (t === xt ? (i.offset = v, I = H.readBytes(i, e), this.processTypeSpec(I)) : t === mt && (i.offset = v, I = H.readBytes(i, e), this.processType(I)), e === 0 || (i.offset = v + e, !i.remaining()))
1734
1754
  break;
1735
1755
  }
1736
1756
  }
@@ -1742,30 +1762,30 @@ class H {
1742
1762
  i.readShort();
1743
1763
  const n = i.readShort();
1744
1764
  i.readInt();
1745
- const a = i.readByte();
1765
+ const s = i.readByte();
1746
1766
  i.readByte(), i.readShort();
1747
- const c = i.readInt(), E = i.readInt(), w = {};
1748
- if (i.readInt(), i.offset = n, n + c * 4 !== E)
1767
+ const c = i.readInt(), w = i.readInt(), d = {};
1768
+ if (i.readInt(), i.offset = n, n + c * 4 !== w)
1749
1769
  throw new Error("HeaderSize, entryCount and entriesStart are not valid.");
1750
- const y = new Array(c);
1751
- for (let I = 0; I < c; ++I)
1752
- y[I] = i.readInt();
1753
- for (let I = 0; I < c; ++I) {
1754
- if (y[I] === -1) continue;
1755
- const N = this.package_id << 24 | a << 16 | I, T = i.offset;
1756
- let m, t, e, r;
1770
+ const E = new Array(c);
1771
+ for (let T = 0; T < c; ++T)
1772
+ E[T] = i.readInt();
1773
+ for (let T = 0; T < c; ++T) {
1774
+ if (E[T] === -1) continue;
1775
+ const U = this.package_id << 24 | s << 16 | T, I = i.offset;
1776
+ let v, t, e, r;
1757
1777
  try {
1758
- i.readShort(), m = i.readShort(), t = i.readInt();
1778
+ i.readShort(), v = i.readShort(), t = i.readInt();
1759
1779
  } catch {
1760
1780
  break;
1761
1781
  }
1762
- if ((m & 1) === 0) {
1782
+ if ((v & 1) === 0) {
1763
1783
  i.readShort(), i.readByte(), e = i.readByte(), r = i.readInt();
1764
- const o = Number(N).toString(16), u = this.keyStringPool[t];
1784
+ const o = Number(U).toString(16), u = this.keyStringPool[t];
1765
1785
  let l = null;
1766
1786
  const p = parseInt(o, 16);
1767
1787
  let F = this.entryMap[p];
1768
- F == null && (F = []), F.push(u), this.entryMap[p] = F, e === vt ? l = this.valueStringPool[r] : e === Tt ? w[o] = r : l = "" + r, this.putIntoMap("@" + o, l), i.offset = T + 8 + 8;
1788
+ F == null && (F = []), F.push(u), this.entryMap[p] = F, e === Ut ? l = this.valueStringPool[r] : e === St ? d[o] = r : l = "" + r, this.putIntoMap("@" + o, l), i.offset = I + 8 + 8;
1769
1789
  } else {
1770
1790
  i.readInt();
1771
1791
  const o = i.readInt();
@@ -1773,11 +1793,11 @@ class H {
1773
1793
  i.readInt(), i.readShort(), i.readByte(), e = i.readByte(), r = i.readInt();
1774
1794
  }
1775
1795
  }
1776
- for (const I in w) {
1777
- const N = this.responseMap["@" + Number(w[I]).toString(16).toUpperCase()];
1778
- if (N != null && Object.keys(N).length < 1e3)
1779
- for (const T of N)
1780
- this.putIntoMap("@" + I, T);
1796
+ for (const T in d) {
1797
+ const U = this.responseMap["@" + Number(d[T]).toString(16).toUpperCase()];
1798
+ if (U != null && Object.keys(U).length < 1e3)
1799
+ for (const I of U)
1800
+ this.putIntoMap("@" + T, I);
1781
1801
  }
1782
1802
  }
1783
1803
  /**
@@ -1789,36 +1809,36 @@ class H {
1789
1809
  i.readShort(), i.readShort(), i.readInt();
1790
1810
  const n = i.readInt();
1791
1811
  i.readInt();
1792
- const a = i.readInt(), c = i.readInt();
1812
+ const s = i.readInt(), c = i.readInt();
1793
1813
  i.readInt();
1794
- let E, w;
1795
- const y = (a & 256) !== 0, I = new Array(n);
1796
- for (let T = 0; T < n; ++T)
1797
- I[T] = i.readInt();
1798
- const N = new Array(n);
1799
- for (let T = 0; T < n; ++T) {
1800
- const m = c + I[T];
1801
- if (i.offset = m, N[T] = "", y) {
1802
- E = i.readUint8(), (E & 128) !== 0 && (E = ((E & 127) << 8) + i.readUint8());
1814
+ let w, d;
1815
+ const E = (s & 256) !== 0, T = new Array(n);
1816
+ for (let I = 0; I < n; ++I)
1817
+ T[I] = i.readInt();
1818
+ const U = new Array(n);
1819
+ for (let I = 0; I < n; ++I) {
1820
+ const v = c + T[I];
1821
+ if (i.offset = v, U[I] = "", E) {
1822
+ w = i.readUint8(), (w & 128) !== 0 && (w = ((w & 127) << 8) + i.readUint8());
1803
1823
  let t = i.readUint8();
1804
1824
  if ((t & 128) !== 0 && (t = ((t & 127) << 8) + i.readUint8()), t > 0) {
1805
- w = H.readBytes(i, t);
1825
+ d = H.readBytes(i, t);
1806
1826
  try {
1807
- N[T] = q.wrap(w, "utf8", !0).toString("utf8");
1827
+ U[I] = q.wrap(d, "utf8", !0).toString("utf8");
1808
1828
  } catch {
1809
1829
  }
1810
1830
  } else
1811
- N[T] = "";
1812
- } else if (E = i.readUint16(), (E & 32768) !== 0 && (E = ((E & 32767) << 16) + i.readUint16()), E > 0) {
1813
- const t = E * 2;
1814
- w = H.readBytes(i, t);
1831
+ U[I] = "";
1832
+ } else if (w = i.readUint16(), (w & 32768) !== 0 && (w = ((w & 32767) << 16) + i.readUint16()), w > 0) {
1833
+ const t = w * 2;
1834
+ d = H.readBytes(i, t);
1815
1835
  try {
1816
- N[T] = q.wrap(w, "utf8", !0).toString("utf8");
1836
+ U[I] = q.wrap(d, "utf8", !0).toString("utf8");
1817
1837
  } catch {
1818
1838
  }
1819
1839
  }
1820
1840
  }
1821
- return N;
1841
+ return U;
1822
1842
  }
1823
1843
  /**
1824
1844
  *
@@ -1826,9 +1846,9 @@ class H {
1826
1846
  */
1827
1847
  processTypeSpec(i) {
1828
1848
  i.readShort(), i.readShort(), i.readInt(), i.readByte(), i.readByte(), i.readShort();
1829
- const n = i.readInt(), a = new Array(n);
1849
+ const n = i.readInt(), s = new Array(n);
1830
1850
  for (let c = 0; c < n; ++c)
1831
- a[c] = i.readInt();
1851
+ s[c] = i.readInt();
1832
1852
  }
1833
1853
  /**
1834
1854
  *
@@ -1836,15 +1856,15 @@ class H {
1836
1856
  * @param {string | null} value - 资源值,可能是 null
1837
1857
  */
1838
1858
  putIntoMap(i, n) {
1839
- const a = i.toUpperCase();
1840
- this.responseMap[a] == null && (this.responseMap[a] = []), n && this.responseMap[a].push(n);
1859
+ const s = i.toUpperCase();
1860
+ this.responseMap[s] == null && (this.responseMap[s] = []), n && this.responseMap[s].push(n);
1841
1861
  }
1842
1862
  }
1843
- const z = {
1863
+ const V = {
1844
1864
  ELEMENT_NODE: 1,
1845
1865
  ATTRIBUTE_NODE: 2,
1846
1866
  CDATA_SECTION_NODE: 4
1847
- }, Y = {
1867
+ }, $ = {
1848
1868
  NULL: 0,
1849
1869
  STRING_POOL: 1,
1850
1870
  XML: 3,
@@ -1854,10 +1874,10 @@ const z = {
1854
1874
  XML_END_ELEMENT: 259,
1855
1875
  XML_CDATA: 260,
1856
1876
  XML_RESOURCE_MAP: 384
1857
- }, Z = {
1877
+ }, G = {
1858
1878
  SORTED: 1,
1859
1879
  UTF8: 256
1860
- }, C = {
1880
+ }, R = {
1861
1881
  COMPLEX_UNIT_DIP: 1,
1862
1882
  COMPLEX_UNIT_FRACTION: 0,
1863
1883
  COMPLEX_UNIT_FRACTION_PARENT: 1,
@@ -1879,7 +1899,7 @@ const z = {
1879
1899
  TYPE_REFERENCE: 1,
1880
1900
  TYPE_STRING: 3
1881
1901
  };
1882
- class It {
1902
+ class At {
1883
1903
  view;
1884
1904
  // Use DataView for reading little-endian data
1885
1905
  cursor;
@@ -1937,24 +1957,24 @@ class It {
1937
1957
  unit: null,
1938
1958
  rawUnit: 0
1939
1959
  // Will be overwritten
1940
- }, n = this.readU32(), a = n & 255;
1941
- switch (i.value = n >> 8, i.rawUnit = a, a) {
1942
- case C.COMPLEX_UNIT_MM:
1960
+ }, n = this.readU32(), s = n & 255;
1961
+ switch (i.value = n >> 8, i.rawUnit = s, s) {
1962
+ case R.COMPLEX_UNIT_MM:
1943
1963
  i.unit = "mm";
1944
1964
  break;
1945
- case C.COMPLEX_UNIT_PX:
1965
+ case R.COMPLEX_UNIT_PX:
1946
1966
  i.unit = "px";
1947
1967
  break;
1948
- case C.COMPLEX_UNIT_DIP:
1968
+ case R.COMPLEX_UNIT_DIP:
1949
1969
  i.unit = "dp";
1950
1970
  break;
1951
- case C.COMPLEX_UNIT_SP:
1971
+ case R.COMPLEX_UNIT_SP:
1952
1972
  i.unit = "sp";
1953
1973
  break;
1954
- case C.COMPLEX_UNIT_PT:
1974
+ case R.COMPLEX_UNIT_PT:
1955
1975
  i.unit = "pt";
1956
1976
  break;
1957
- case C.COMPLEX_UNIT_IN:
1977
+ case R.COMPLEX_UNIT_IN:
1958
1978
  i.unit = "in";
1959
1979
  break;
1960
1980
  }
@@ -1968,12 +1988,12 @@ class It {
1968
1988
  type: null,
1969
1989
  rawType: 0
1970
1990
  // Will be overwritten
1971
- }, n = this.readU32(), a = n & 15;
1972
- switch (i.value = this.convertIntToFloat(n >> 4), i.rawType = a, a) {
1973
- case C.COMPLEX_UNIT_FRACTION:
1991
+ }, n = this.readU32(), s = n & 15;
1992
+ switch (i.value = this.convertIntToFloat(n >> 4), i.rawType = s, s) {
1993
+ case R.COMPLEX_UNIT_FRACTION:
1974
1994
  i.type = "%";
1975
1995
  break;
1976
- case C.COMPLEX_UNIT_FRACTION_PARENT:
1996
+ case R.COMPLEX_UNIT_FRACTION_PARENT:
1977
1997
  i.type = "%p";
1978
1998
  break;
1979
1999
  }
@@ -1997,57 +2017,57 @@ class It {
1997
2017
  rawType: 0
1998
2018
  // Will be overwritten
1999
2019
  }, n = this.cursor;
2000
- let a = this.readU16();
2020
+ let s = this.readU16();
2001
2021
  this.readU8();
2002
2022
  const c = this.readU8();
2003
- switch (a === 0 && (a = 8), i.rawType = c, c) {
2004
- case C.TYPE_INT_DEC:
2023
+ switch (s === 0 && (s = 8), i.rawType = c, c) {
2024
+ case R.TYPE_INT_DEC:
2005
2025
  i.value = this.readS32(), i.type = "int_dec";
2006
2026
  break;
2007
- case C.TYPE_INT_HEX:
2027
+ case R.TYPE_INT_HEX:
2008
2028
  i.value = this.readS32(), i.type = "int_hex";
2009
2029
  break;
2010
- case C.TYPE_STRING:
2011
- const w = this.readS32();
2012
- i.value = w >= 0 ? this.strings[w] : "", i.type = "string";
2030
+ case R.TYPE_STRING:
2031
+ const d = this.readS32();
2032
+ i.value = d >= 0 ? this.strings[d] : "", i.type = "string";
2013
2033
  break;
2014
- case C.TYPE_REFERENCE:
2015
- const y = this.readU32();
2016
- i.value = `resourceId:0x${y.toString(16)}`, i.type = "reference";
2034
+ case R.TYPE_REFERENCE:
2035
+ const E = this.readU32();
2036
+ i.value = `resourceId:0x${E.toString(16)}`, i.type = "reference";
2017
2037
  break;
2018
- case C.TYPE_INT_BOOLEAN:
2038
+ case R.TYPE_INT_BOOLEAN:
2019
2039
  i.value = this.readS32() !== 0, i.type = "boolean";
2020
2040
  break;
2021
- case C.TYPE_NULL:
2041
+ case R.TYPE_NULL:
2022
2042
  this.readU32(), i.value = null, i.type = "null";
2023
2043
  break;
2024
- case C.TYPE_INT_COLOR_RGB8:
2044
+ case R.TYPE_INT_COLOR_RGB8:
2025
2045
  i.value = this.readHex24(), i.type = "rgb8";
2026
2046
  break;
2027
- case C.TYPE_INT_COLOR_RGB4:
2047
+ case R.TYPE_INT_COLOR_RGB4:
2028
2048
  i.value = this.readHex24(), i.type = "rgb4";
2029
2049
  break;
2030
- case C.TYPE_INT_COLOR_ARGB8:
2050
+ case R.TYPE_INT_COLOR_ARGB8:
2031
2051
  i.value = this.readHex32(), i.type = "argb8";
2032
2052
  break;
2033
- case C.TYPE_INT_COLOR_ARGB4:
2053
+ case R.TYPE_INT_COLOR_ARGB4:
2034
2054
  i.value = this.readHex32(), i.type = "argb4";
2035
2055
  break;
2036
- case C.TYPE_DIMENSION:
2056
+ case R.TYPE_DIMENSION:
2037
2057
  i.value = this.readDimension(), i.type = "dimension";
2038
2058
  break;
2039
- case C.TYPE_FRACTION:
2059
+ case R.TYPE_FRACTION:
2040
2060
  i.value = this.readFraction(), i.type = "fraction";
2041
2061
  break;
2042
2062
  default: {
2043
- const I = c.toString(16);
2044
- console.debug(`Not sure what to do with typed value of type 0x${I}, falling back to reading an uint32.`), i.value = this.readU32(), i.type = "unknown";
2063
+ const T = c.toString(16);
2064
+ console.debug(`Not sure what to do with typed value of type 0x${T}, falling back to reading an uint32.`), i.value = this.readU32(), i.type = "unknown";
2045
2065
  }
2046
2066
  }
2047
- const E = n + a;
2048
- if (this.cursor !== E) {
2049
- const w = c.toString(16), y = E - this.cursor;
2050
- console.debug(`Cursor is off by ${y} bytes at ${this.cursor} at supposed end of typed value of type 0x${w}. The typed value started at offset ${n} and is supposed to end at offset ${E}. Ignoring the rest of the value.`), this.cursor = E;
2067
+ const w = n + s;
2068
+ if (this.cursor !== w) {
2069
+ const d = c.toString(16), E = w - this.cursor;
2070
+ console.debug(`Cursor is off by ${E} bytes at ${this.cursor} at supposed end of typed value of type 0x${d}. The typed value started at offset ${n} and is supposed to end at offset ${w}. Ignoring the rest of the value.`), this.cursor = w;
2051
2071
  }
2052
2072
  return this.debug && console.groupEnd(), i;
2053
2073
  }
@@ -2059,21 +2079,21 @@ class It {
2059
2079
  // Use TextDecoder for browser compatibility
2060
2080
  readString(i) {
2061
2081
  this.debug && console.group("readString", i);
2062
- let n, a;
2082
+ let n, s;
2063
2083
  switch (i) {
2064
2084
  case "utf-8":
2065
- a = this.readLength8(), this.debug && console.debug("stringLength:", a), n = this.readLength8(), this.debug && console.debug("byteLength:", n);
2085
+ s = this.readLength8(), this.debug && console.debug("stringLength:", s), n = this.readLength8(), this.debug && console.debug("byteLength:", n);
2066
2086
  break;
2067
2087
  // Continue below to decode using TextDecoder
2068
2088
  case "ucs2":
2069
- a = this.readLength16(), this.debug && console.debug("stringLength:", a), n = a * 2, this.debug && console.debug("byteLength:", n);
2089
+ s = this.readLength16(), this.debug && console.debug("stringLength:", s), n = s * 2, this.debug && console.debug("byteLength:", n);
2070
2090
  break;
2071
2091
  // Continue below to decode using TextDecoder
2072
2092
  default:
2073
2093
  throw new Error(`Unsupported encoding '${i}'`);
2074
2094
  }
2075
- const c = new TextDecoder(i === "ucs2" ? "utf-16le" : i), E = new Uint8Array(this.view.buffer, this.cursor, n), w = c.decode(E);
2076
- return this.cursor += n, this.debug && (console.debug("value:", w), console.groupEnd()), w;
2095
+ const c = new TextDecoder(i === "ucs2" ? "utf-16le" : i), w = new Uint8Array(this.view.buffer, this.cursor, n), d = c.decode(w);
2096
+ return this.cursor += n, this.debug && (console.debug("value:", d), console.groupEnd()), d;
2077
2097
  }
2078
2098
  readChunkHeader() {
2079
2099
  this.debug && console.group("readChunkHeader");
@@ -2086,24 +2106,24 @@ class It {
2086
2106
  return this.debug && (console.debug("startOffset:", i.startOffset), console.debug("chunkType:", i.chunkType), console.debug("headerSize:", i.headerSize), console.debug("chunkSize:", i.chunkSize), console.groupEnd()), i;
2087
2107
  }
2088
2108
  readStringPool(i) {
2089
- if (this.debug && console.group("readStringPool"), i.stringCount = this.readU32(), this.debug && console.debug("stringCount:", i.stringCount), i.styleCount = this.readU32(), this.debug && console.debug("styleCount:", i.styleCount), i.flags = this.readU32(), this.debug && console.debug("flags:", i.flags), i.stringsStart = this.readU32(), this.debug && console.debug("stringsStart:", i.stringsStart), i.stylesStart = this.readU32(), this.debug && console.debug("stylesStart:", i.stylesStart), i.chunkType !== Y.STRING_POOL)
2109
+ if (this.debug && console.group("readStringPool"), i.stringCount = this.readU32(), this.debug && console.debug("stringCount:", i.stringCount), i.styleCount = this.readU32(), this.debug && console.debug("styleCount:", i.styleCount), i.flags = this.readU32(), this.debug && console.debug("flags:", i.flags), i.stringsStart = this.readU32(), this.debug && console.debug("stringsStart:", i.stringsStart), i.stylesStart = this.readU32(), this.debug && console.debug("stylesStart:", i.stylesStart), i.chunkType !== $.STRING_POOL)
2090
2110
  throw new Error("Invalid string pool header");
2091
2111
  const n = [];
2092
- for (let w = 0, y = i.stringCount; w < y; ++w)
2093
- this.debug && console.debug("offset:", w), n.push(this.readU32());
2094
- const a = (i.flags & Z.SORTED) === Z.SORTED;
2095
- this.debug && console.debug("sorted:", a);
2096
- const c = (i.flags & Z.UTF8) === Z.UTF8 ? "utf-8" : "ucs2";
2112
+ for (let d = 0, E = i.stringCount; d < E; ++d)
2113
+ this.debug && console.debug("offset:", d), n.push(this.readU32());
2114
+ const s = (i.flags & G.SORTED) === G.SORTED;
2115
+ this.debug && console.debug("sorted:", s);
2116
+ const c = (i.flags & G.UTF8) === G.UTF8 ? "utf-8" : "ucs2";
2097
2117
  this.debug && console.debug("encoding:", c);
2098
- const E = i.startOffset + (i.stringsStart || 0);
2099
- for (let w = 0, y = i.stringCount; w < y; ++w)
2100
- this.debug && (console.debug("string:", w), console.debug("offset:", n[w])), this.cursor = E + n[w], this.strings.push(this.readString(c));
2118
+ const w = i.startOffset + (i.stringsStart || 0);
2119
+ for (let d = 0, E = i.stringCount; d < E; ++d)
2120
+ this.debug && (console.debug("string:", d), console.debug("offset:", n[d])), this.cursor = w + n[d], this.strings.push(this.readString(c));
2101
2121
  return this.cursor = i.startOffset + i.chunkSize, this.debug && console.groupEnd(), null;
2102
2122
  }
2103
2123
  readResourceMap(i) {
2104
2124
  this.debug && console.group("readResourceMap");
2105
2125
  const n = Math.floor((i.chunkSize - i.headerSize) / 4);
2106
- for (let a = 0; a < n; ++a)
2126
+ for (let s = 0; s < n; ++s)
2107
2127
  this.resources.push(this.readU32());
2108
2128
  return this.debug && console.groupEnd(), null;
2109
2129
  }
@@ -2117,32 +2137,32 @@ class It {
2117
2137
  this.debug && console.group("readXmlElementStart", i);
2118
2138
  const n = {
2119
2139
  namespaceURI: null,
2120
- nodeType: z.ELEMENT_NODE,
2140
+ nodeType: V.ELEMENT_NODE,
2121
2141
  nodeName: null,
2122
2142
  attributes: [],
2123
2143
  childNodes: []
2124
2144
  };
2125
2145
  this.readU32(), this.readU32();
2126
- const a = this.readS32(), c = this.readS32();
2127
- a >= 0 && (n.namespaceURI = this.strings[a]), c >= 0 && (n.nodeName = this.strings[c]), this.readU16(), this.readU16();
2128
- const E = this.readU16();
2146
+ const s = this.readS32(), c = this.readS32();
2147
+ s >= 0 && (n.namespaceURI = this.strings[s]), c >= 0 && (n.nodeName = this.strings[c]), this.readU16(), this.readU16();
2148
+ const w = this.readU16();
2129
2149
  this.readU16(), this.readU16(), this.readU16();
2130
- for (let w = 0; w < E; ++w)
2150
+ for (let d = 0; d < w; ++d)
2131
2151
  n.attributes.push(this.readXmlAttribute());
2132
- return this.document ? (this.parent && this.parent.nodeType === z.ELEMENT_NODE && this.parent.childNodes.push(n), this.parent = n) : this.document = this.parent = n, this.stack.push(n), this.debug && console.groupEnd(), n;
2152
+ return this.document ? (this.parent && this.parent.nodeType === V.ELEMENT_NODE && this.parent.childNodes.push(n), this.parent = n) : this.document = this.parent = n, this.stack.push(n), this.debug && console.groupEnd(), n;
2133
2153
  }
2134
2154
  readXmlAttribute() {
2135
2155
  this.debug && console.group("readXmlAttribute");
2136
2156
  const i = {
2137
2157
  namespaceURI: null,
2138
- nodeType: z.ATTRIBUTE_NODE,
2158
+ nodeType: V.ATTRIBUTE_NODE,
2139
2159
  nodeName: null,
2140
2160
  name: null,
2141
2161
  value: null,
2142
2162
  typedValue: {}
2143
2163
  // Will be overwritten
2144
- }, n = this.readS32(), a = this.readS32(), c = this.readS32();
2145
- return n >= 0 && (i.namespaceURI = this.strings[n]), a >= 0 && (i.nodeName = i.name = this.strings[a]), c >= 0 && (i.name === "versionName" && this.strings[c] && (this.strings[c] = this.strings[c].replace(/[^\d\w-.]/g, "")), i.value = this.strings[c]), i.typedValue = this.readTypedValue(), this.debug && console.groupEnd(), i;
2164
+ }, n = this.readS32(), s = this.readS32(), c = this.readS32();
2165
+ return n >= 0 && (i.namespaceURI = this.strings[n]), s >= 0 && (i.nodeName = i.name = this.strings[s]), c >= 0 && (i.name === "versionName" && this.strings[c] && (this.strings[c] = this.strings[c].replace(/[^\d\w-.]/g, "")), i.value = this.strings[c]), i.typedValue = this.readTypedValue(), this.debug && console.groupEnd(), i;
2146
2166
  }
2147
2167
  readXmlElementEnd(i) {
2148
2168
  return this.debug && console.group("readXmlCData", i), this.readU32(), this.readU32(), this.readS32(), this.readS32(), this.stack.pop(), this.parent = this.stack[this.stack.length - 1] || null, this.debug && console.groupEnd(), null;
@@ -2151,15 +2171,15 @@ class It {
2151
2171
  this.debug && console.group("readXmlCData", i);
2152
2172
  const n = {
2153
2173
  namespaceURI: null,
2154
- nodeType: z.CDATA_SECTION_NODE,
2174
+ nodeType: V.CDATA_SECTION_NODE,
2155
2175
  nodeName: "#cdata",
2156
2176
  data: null,
2157
2177
  typedValue: {}
2158
2178
  // Will be overwritten
2159
2179
  };
2160
2180
  this.readU32(), this.readU32();
2161
- const a = this.readS32();
2162
- return a >= 0 && (n.data = this.strings[a]), n.typedValue = this.readTypedValue(), this.parent && this.parent.nodeType === z.ELEMENT_NODE && this.parent.childNodes.push(n), this.debug && console.groupEnd(), n;
2181
+ const s = this.readS32();
2182
+ return s >= 0 && (n.data = this.strings[s]), n.typedValue = this.readTypedValue(), this.parent && this.parent.nodeType === V.ELEMENT_NODE && this.parent.childNodes.push(n), this.debug && console.groupEnd(), n;
2163
2183
  }
2164
2184
  readNull(i) {
2165
2185
  return this.debug && console.group("readNull"), this.cursor += i.chunkSize - i.headerSize, this.debug && console.groupEnd(), null;
@@ -2169,51 +2189,51 @@ class It {
2169
2189
  * @returns The root XML element of the parsed document.
2170
2190
  */
2171
2191
  parse() {
2172
- if (this.debug && console.group("BinaryXmlParser.parse"), this.readChunkHeader().chunkType !== Y.XML)
2192
+ if (this.debug && console.group("BinaryXmlParser.parse"), this.readChunkHeader().chunkType !== $.XML)
2173
2193
  throw new Error("Invalid XML header");
2174
2194
  for (; this.cursor < this.view.byteLength; ) {
2175
2195
  this.debug && console.group("chunk");
2176
- const n = this.cursor, a = this.readChunkHeader();
2177
- switch (a.chunkType) {
2178
- case Y.STRING_POOL:
2179
- this.readStringPool(a);
2196
+ const n = this.cursor, s = this.readChunkHeader();
2197
+ switch (s.chunkType) {
2198
+ case $.STRING_POOL:
2199
+ this.readStringPool(s);
2180
2200
  break;
2181
- case Y.XML_RESOURCE_MAP:
2182
- this.readResourceMap(a);
2201
+ case $.XML_RESOURCE_MAP:
2202
+ this.readResourceMap(s);
2183
2203
  break;
2184
- case Y.XML_START_NAMESPACE:
2185
- this.readXmlNamespaceStart(a);
2204
+ case $.XML_START_NAMESPACE:
2205
+ this.readXmlNamespaceStart(s);
2186
2206
  break;
2187
- case Y.XML_END_NAMESPACE:
2188
- this.readXmlNamespaceEnd(a);
2207
+ case $.XML_END_NAMESPACE:
2208
+ this.readXmlNamespaceEnd(s);
2189
2209
  break;
2190
- case Y.XML_START_ELEMENT:
2191
- this.readXmlElementStart(a);
2210
+ case $.XML_START_ELEMENT:
2211
+ this.readXmlElementStart(s);
2192
2212
  break;
2193
- case Y.XML_END_ELEMENT:
2194
- this.readXmlElementEnd(a);
2213
+ case $.XML_END_ELEMENT:
2214
+ this.readXmlElementEnd(s);
2195
2215
  break;
2196
- case Y.XML_CDATA:
2197
- this.readXmlCData(a);
2216
+ case $.XML_CDATA:
2217
+ this.readXmlCData(s);
2198
2218
  break;
2199
- case Y.NULL:
2200
- this.readNull(a);
2219
+ case $.NULL:
2220
+ this.readNull(s);
2201
2221
  break;
2202
2222
  default:
2203
- throw new Error(`Unsupported chunk type '0x${a.chunkType.toString(16)}'`);
2223
+ throw new Error(`Unsupported chunk type '0x${s.chunkType.toString(16)}'`);
2204
2224
  }
2205
- const c = n + a.chunkSize;
2225
+ const c = n + s.chunkSize;
2206
2226
  if (this.cursor !== c) {
2207
- const E = c - this.cursor, w = a.chunkType.toString(16);
2208
- console.debug(`Cursor is off by ${E} bytes at ${this.cursor} at supposed end of chunk of type 0x${w}. The chunk started at offset ${n} and is supposed to end at offset ${c}. Ignoring the rest of the chunk.`), this.cursor = c;
2227
+ const w = c - this.cursor, d = s.chunkType.toString(16);
2228
+ console.debug(`Cursor is off by ${w} bytes at ${this.cursor} at supposed end of chunk of type 0x${d}. The chunk started at offset ${n} and is supposed to end at offset ${c}. Ignoring the rest of the chunk.`), this.cursor = c;
2209
2229
  }
2210
2230
  this.debug && console.groupEnd();
2211
2231
  }
2212
2232
  return this.debug && console.groupEnd(), this.document;
2213
2233
  }
2214
2234
  }
2215
- const mt = "android.intent.action.MAIN", xt = "android.intent.category.LAUNCHER";
2216
- class St {
2235
+ const Nt = "android.intent.action.MAIN", Lt = "android.intent.category.LAUNCHER";
2236
+ class _t {
2217
2237
  buffer;
2218
2238
  xmlParser;
2219
2239
  /**
@@ -2221,7 +2241,7 @@ class St {
2221
2241
  * @param options Configuration options for the underlying BinaryXmlParser.
2222
2242
  */
2223
2243
  constructor(i, n = {}) {
2224
- this.buffer = i, this.xmlParser = new It(this.buffer, n);
2244
+ this.buffer = i, this.xmlParser = new At(this.buffer, n);
2225
2245
  }
2226
2246
  /**
2227
2247
  * Flattens the attributes of an XML element into a simple key/value object.
@@ -2231,38 +2251,38 @@ class St {
2231
2251
  */
2232
2252
  collapseAttributes(i) {
2233
2253
  const n = /* @__PURE__ */ Object.create(null);
2234
- if (i.nodeType === z.ELEMENT_NODE)
2235
- for (const a of Array.from(i.attributes))
2236
- n[a.name] = a.typedValue.value;
2254
+ if (i.nodeType === V.ELEMENT_NODE)
2255
+ for (const s of Array.from(i.attributes))
2256
+ n[s.name] = s.typedValue.value;
2237
2257
  return n;
2238
2258
  }
2239
2259
  /**
2240
2260
  * Parses child nodes of a component into intent filters and meta data.
2241
2261
  */
2242
2262
  parseIntents(i, n) {
2243
- n.intentFilters = [], n.metaData = [], i.childNodes.forEach((a) => {
2244
- if (a.nodeType === z.ELEMENT_NODE)
2245
- switch (a.nodeName) {
2263
+ n.intentFilters = [], n.metaData = [], i.childNodes.forEach((s) => {
2264
+ if (s.nodeType === V.ELEMENT_NODE)
2265
+ switch (s.nodeName) {
2246
2266
  case "intent-filter": {
2247
- const c = this.collapseAttributes(a);
2248
- c.actions = [], c.categories = [], c.data = [], a.childNodes.forEach((E) => {
2249
- if (E.nodeType === z.ELEMENT_NODE)
2250
- switch (E.nodeName) {
2267
+ const c = this.collapseAttributes(s);
2268
+ c.actions = [], c.categories = [], c.data = [], s.childNodes.forEach((w) => {
2269
+ if (w.nodeType === V.ELEMENT_NODE)
2270
+ switch (w.nodeName) {
2251
2271
  case "action":
2252
- c.actions.push(this.collapseAttributes(E));
2272
+ c.actions.push(this.collapseAttributes(w));
2253
2273
  break;
2254
2274
  case "category":
2255
- c.categories.push(this.collapseAttributes(E));
2275
+ c.categories.push(this.collapseAttributes(w));
2256
2276
  break;
2257
2277
  case "data":
2258
- c.data.push(this.collapseAttributes(E));
2278
+ c.data.push(this.collapseAttributes(w));
2259
2279
  break;
2260
2280
  }
2261
2281
  }), n.intentFilters.push(c);
2262
2282
  break;
2263
2283
  }
2264
2284
  case "meta-data":
2265
- n.metaData.push(this.collapseAttributes(a));
2285
+ n.metaData.push(this.collapseAttributes(s));
2266
2286
  break;
2267
2287
  }
2268
2288
  });
@@ -2274,52 +2294,52 @@ class St {
2274
2294
  */
2275
2295
  parseApplication(i) {
2276
2296
  const n = this.collapseAttributes(i);
2277
- return n.activities = [], n.activityAliases = [], n.launcherActivities = [], n.services = [], n.receivers = [], n.providers = [], n.usesLibraries = [], n.metaData = [], i.childNodes.forEach((a) => {
2278
- if (a.nodeType === z.ELEMENT_NODE)
2279
- switch (a.nodeName) {
2297
+ return n.activities = [], n.activityAliases = [], n.launcherActivities = [], n.services = [], n.receivers = [], n.providers = [], n.usesLibraries = [], n.metaData = [], i.childNodes.forEach((s) => {
2298
+ if (s.nodeType === V.ELEMENT_NODE)
2299
+ switch (s.nodeName) {
2280
2300
  case "activity": {
2281
- const c = this.collapseAttributes(a);
2282
- this.parseIntents(a, c), n.activities.push(c), this.isLauncherActivity(c) && n.launcherActivities.push(c);
2301
+ const c = this.collapseAttributes(s);
2302
+ this.parseIntents(s, c), n.activities.push(c), this.isLauncherActivity(c) && n.launcherActivities.push(c);
2283
2303
  break;
2284
2304
  }
2285
2305
  case "activity-alias": {
2286
- const c = this.collapseAttributes(a);
2287
- this.parseIntents(a, c), n.activityAliases.push(c), this.isLauncherActivity(c) && n.launcherActivities.push(c);
2306
+ const c = this.collapseAttributes(s);
2307
+ this.parseIntents(s, c), n.activityAliases.push(c), this.isLauncherActivity(c) && n.launcherActivities.push(c);
2288
2308
  break;
2289
2309
  }
2290
2310
  case "service": {
2291
- const c = this.collapseAttributes(a);
2292
- this.parseIntents(a, c), n.services.push(c);
2311
+ const c = this.collapseAttributes(s);
2312
+ this.parseIntents(s, c), n.services.push(c);
2293
2313
  break;
2294
2314
  }
2295
2315
  case "receiver": {
2296
- const c = this.collapseAttributes(a);
2297
- this.parseIntents(a, c), n.receivers.push(c);
2316
+ const c = this.collapseAttributes(s);
2317
+ this.parseIntents(s, c), n.receivers.push(c);
2298
2318
  break;
2299
2319
  }
2300
2320
  case "provider": {
2301
- const c = this.collapseAttributes(a);
2302
- c.grantUriPermissions = [], c.metaData = [], c.pathPermissions = [], a.childNodes.forEach((E) => {
2303
- if (E.nodeType === z.ELEMENT_NODE)
2304
- switch (E.nodeName) {
2321
+ const c = this.collapseAttributes(s);
2322
+ c.grantUriPermissions = [], c.metaData = [], c.pathPermissions = [], s.childNodes.forEach((w) => {
2323
+ if (w.nodeType === V.ELEMENT_NODE)
2324
+ switch (w.nodeName) {
2305
2325
  case "grant-uri-permission":
2306
- c.grantUriPermissions.push(this.collapseAttributes(E));
2326
+ c.grantUriPermissions.push(this.collapseAttributes(w));
2307
2327
  break;
2308
2328
  case "meta-data":
2309
- c.metaData.push(this.collapseAttributes(E));
2329
+ c.metaData.push(this.collapseAttributes(w));
2310
2330
  break;
2311
2331
  case "path-permission":
2312
- c.pathPermissions.push(this.collapseAttributes(E));
2332
+ c.pathPermissions.push(this.collapseAttributes(w));
2313
2333
  break;
2314
2334
  }
2315
2335
  }), n.providers.push(c);
2316
2336
  break;
2317
2337
  }
2318
2338
  case "uses-library":
2319
- n.usesLibraries.push(this.collapseAttributes(a));
2339
+ n.usesLibraries.push(this.collapseAttributes(s));
2320
2340
  break;
2321
2341
  case "meta-data":
2322
- n.metaData.push(this.collapseAttributes(a));
2342
+ n.metaData.push(this.collapseAttributes(s));
2323
2343
  break;
2324
2344
  }
2325
2345
  }), n;
@@ -2331,7 +2351,7 @@ class St {
2331
2351
  */
2332
2352
  isLauncherActivity(i) {
2333
2353
  return i.intentFilters.some(function(n) {
2334
- return n.actions.some((c) => c.name === mt) ? n.categories.some((c) => c.name === xt) : !1;
2354
+ return n.actions.some((c) => c.name === Nt) ? n.categories.some((c) => c.name === Lt) : !1;
2335
2355
  });
2336
2356
  }
2337
2357
  /**
@@ -2340,89 +2360,101 @@ class St {
2340
2360
  */
2341
2361
  parse() {
2342
2362
  const i = this.xmlParser.parse(), n = this.collapseAttributes(i);
2343
- return n.usesPermissions = [], n.usesPermissionsSDK23 = [], n.permissions = [], n.permissionTrees = [], n.permissionGroups = [], n.instrumentation = null, n.usesSdk = null, n.usesConfiguration = null, n.usesFeatures = [], n.supportsScreens = null, n.compatibleScreens = [], n.supportsGlTextures = [], i.childNodes.forEach((a) => {
2344
- if (a.nodeType === z.ELEMENT_NODE)
2345
- switch (a.nodeName) {
2363
+ return n.usesPermissions = [], n.usesPermissionsSDK23 = [], n.permissions = [], n.permissionTrees = [], n.permissionGroups = [], n.instrumentation = null, n.usesSdk = null, n.usesConfiguration = null, n.usesFeatures = [], n.supportsScreens = null, n.compatibleScreens = [], n.supportsGlTextures = [], i.childNodes.forEach((s) => {
2364
+ if (s.nodeType === V.ELEMENT_NODE)
2365
+ switch (s.nodeName) {
2346
2366
  case "uses-permission":
2347
- n.usesPermissions.push(this.collapseAttributes(a));
2367
+ n.usesPermissions.push(this.collapseAttributes(s));
2348
2368
  break;
2349
2369
  case "uses-permission-sdk-23":
2350
- n.usesPermissionsSDK23.push(this.collapseAttributes(a));
2370
+ n.usesPermissionsSDK23.push(this.collapseAttributes(s));
2351
2371
  break;
2352
2372
  case "permission":
2353
- n.permissions.push(this.collapseAttributes(a));
2373
+ n.permissions.push(this.collapseAttributes(s));
2354
2374
  break;
2355
2375
  case "permission-tree":
2356
- n.permissionTrees.push(this.collapseAttributes(a));
2376
+ n.permissionTrees.push(this.collapseAttributes(s));
2357
2377
  break;
2358
2378
  case "permission-group":
2359
- n.permissionGroups.push(this.collapseAttributes(a));
2379
+ n.permissionGroups.push(this.collapseAttributes(s));
2360
2380
  break;
2361
2381
  case "instrumentation":
2362
- n.instrumentation = this.collapseAttributes(a);
2382
+ n.instrumentation = this.collapseAttributes(s);
2363
2383
  break;
2364
2384
  case "uses-sdk":
2365
- n.usesSdk = this.collapseAttributes(a);
2385
+ n.usesSdk = this.collapseAttributes(s);
2366
2386
  break;
2367
2387
  case "uses-configuration":
2368
- n.usesConfiguration = this.collapseAttributes(a);
2388
+ n.usesConfiguration = this.collapseAttributes(s);
2369
2389
  break;
2370
2390
  case "uses-feature":
2371
- n.usesFeatures.push(this.collapseAttributes(a));
2391
+ n.usesFeatures.push(this.collapseAttributes(s));
2372
2392
  break;
2373
2393
  case "supports-screens":
2374
- n.supportsScreens = this.collapseAttributes(a);
2394
+ n.supportsScreens = this.collapseAttributes(s);
2375
2395
  break;
2376
2396
  case "compatible-screens":
2377
- a.childNodes.forEach((c) => {
2378
- if (c.nodeType === z.ELEMENT_NODE)
2397
+ s.childNodes.forEach((c) => {
2398
+ if (c.nodeType === V.ELEMENT_NODE)
2379
2399
  return n.compatibleScreens.push(this.collapseAttributes(c));
2380
2400
  });
2381
2401
  break;
2382
2402
  case "supports-gl-texture":
2383
- n.supportsGlTextures.push(this.collapseAttributes(a));
2403
+ n.supportsGlTextures.push(this.collapseAttributes(s));
2384
2404
  break;
2385
2405
  case "application":
2386
- n.application = this.parseApplication(a);
2406
+ n.application = this.parseApplication(s);
2387
2407
  break;
2388
2408
  }
2389
2409
  }), n;
2390
2410
  }
2391
2411
  }
2392
- async function Dt(g, i) {
2393
- const n = await J(g).catch(B);
2394
- if (n instanceof Error)
2395
- return new Error(`load APK error: ${n.message}`);
2396
- const a = n.file("AndroidManifest.xml"), c = i?.ignoreIcon ? null : n.file("resources.arsc"), [E, w] = await Promise.all([
2397
- a?.async("arraybuffer").catch(B),
2398
- c?.async("arraybuffer").catch(B)
2399
- ]);
2400
- if (!E || E instanceof Error)
2401
- return new Error("not found AndroidManifest.xml");
2402
- const y = Nt(E);
2403
- if (y instanceof Error)
2404
- return new Error(`parse AndroidManifest.xml error: ${y.message}`);
2405
- const I = {
2406
- package: y.package,
2407
- versionCode: y.versionCode,
2408
- versionName: y.versionName,
2409
- manifest: y,
2410
- application: y.application,
2411
- metaData: y.application?.metaData
2412
- }, N = y.application?.icon;
2413
- if (!w || w instanceof Error || !N || typeof N != "string")
2414
- return I;
2415
- const T = Ut(w, N);
2416
- if (!T)
2417
- return I;
2418
- const m = n.file(T);
2419
- if (!m)
2420
- return I;
2421
- const t = await m.async("base64").catch(B);
2422
- return t instanceof Error || (I.icon = rt(t)), I;
2412
+ const kt = rt.loadAsync;
2413
+ class Wt {
2414
+ zip;
2415
+ constructor(i) {
2416
+ this.zip = kt(i).catch(P);
2417
+ }
2418
+ async parse(i) {
2419
+ const n = await this.zip;
2420
+ if (n instanceof Error)
2421
+ return new Error(`load file error: ${n.message}`);
2422
+ const s = n.file("AndroidManifest.xml"), c = i?.ignoreIcon ? null : n.file("resources.arsc"), [w, d] = await Promise.all([
2423
+ s?.async("arraybuffer").catch(P),
2424
+ c?.async("arraybuffer").catch(P)
2425
+ ]);
2426
+ if (!w || w instanceof Error)
2427
+ return new Error("not found AndroidManifest.xml");
2428
+ const E = Ct(w);
2429
+ if (E instanceof Error)
2430
+ return new Error(`parse AndroidManifest.xml error: ${E.message}`);
2431
+ const T = {
2432
+ package: E.package,
2433
+ versionCode: E.versionCode,
2434
+ versionName: E.versionName,
2435
+ manifest: E
2436
+ }, U = E.application?.icon;
2437
+ if (!d || d instanceof Error || !U || typeof U != "string")
2438
+ return T;
2439
+ const I = Rt(d, U);
2440
+ if (!I)
2441
+ return T;
2442
+ const v = n.file(I);
2443
+ if (!v)
2444
+ return T;
2445
+ const t = await v.async("base64").catch(P);
2446
+ return t instanceof Error || (T.icon = it(t)), T;
2447
+ }
2448
+ /**
2449
+ * 读取指定文件的内容
2450
+ */
2451
+ async readFile(i, n) {
2452
+ const s = await this.zip;
2453
+ return s instanceof Error ? new Error(`load file error: ${s.message}`) : await nt(s, i, n);
2454
+ }
2423
2455
  }
2424
- function Nt(g) {
2425
- const i = new St(g, {
2456
+ function Ct(f) {
2457
+ const i = new _t(f, {
2426
2458
  ignore: [
2427
2459
  "application.activity",
2428
2460
  "application.service",
@@ -2434,80 +2466,120 @@ function Nt(g) {
2434
2466
  try {
2435
2467
  return i.parse();
2436
2468
  } catch (n) {
2437
- return B(n);
2469
+ return P(n);
2438
2470
  }
2439
2471
  }
2440
- function Ut(g, i) {
2472
+ function Rt(f, i) {
2441
2473
  try {
2442
- const n = new H().processResourceTable(g), a = i.replace(/^resourceId:0x/, "@").toUpperCase();
2443
- return n[a]?.[0] || "";
2474
+ const n = new H().processResourceTable(f), s = i.replace(/^resourceId:0x/, "@").toUpperCase();
2475
+ return n[s]?.[0] || "";
2444
2476
  } catch {
2445
2477
  return "";
2446
2478
  }
2447
2479
  }
2448
- typeof globalThis < "u" || typeof self < "u" || typeof window < "u" || Function("return this")();
2449
- function G(g, ...i) {
2450
- if (!g || typeof g != "object") return !1;
2451
- const n = Object.getPrototypeOf(g);
2452
- return n !== Object.prototype && n !== null ? !1 : i.every((a) => a in g);
2480
+ const Z = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Function("return this")();
2481
+ function Ot(f) {
2482
+ return typeof f == "function";
2453
2483
  }
2454
- class At {
2484
+ function lt(f) {
2485
+ return typeof f == "object" && f !== null;
2486
+ }
2487
+ function Pt() {
2488
+ return "wx" in Z && lt(Z.wx) && "getSystemInfo" in Z.wx && Ot(Z.wx.getSystemInfo);
2489
+ }
2490
+ function Bt() {
2491
+ return "window" in Z && lt(Z.window) && !Pt();
2492
+ }
2493
+ function W(f, ...i) {
2494
+ if (!f || typeof f != "object") return !1;
2495
+ const n = Object.getPrototypeOf(f);
2496
+ return n !== Object.prototype && n !== null ? !1 : i.every((s) => s in f);
2497
+ }
2498
+ function Mt(f) {
2499
+ const i = new DataView(f);
2500
+ if (f.byteLength < 8)
2501
+ return f;
2502
+ const n = new Uint8Array(f, 0, 8), s = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
2503
+ for (let r = 0; r < 8; r++)
2504
+ if (n[r] !== s[r])
2505
+ return f;
2506
+ if (f.byteLength < 20)
2507
+ return f;
2508
+ const c = 8, w = i.getUint32(c, !1), d = new Uint8Array(f, c + 4, 4);
2509
+ if (String.fromCharCode(d[0], d[1], d[2], d[3]) !== "CgBI")
2510
+ return f;
2511
+ const T = c + 12 + w;
2512
+ if (f.byteLength < T)
2513
+ return f;
2514
+ const U = f.byteLength - (12 + w), I = new ArrayBuffer(U), v = new Uint8Array(I), t = new Uint8Array(f, 0, c);
2515
+ v.set(t, 0);
2516
+ const e = new Uint8Array(f, T);
2517
+ return v.set(e, c), I;
2518
+ }
2519
+ function Dt(f) {
2520
+ const i = new Uint8Array(f);
2521
+ let n = "";
2522
+ for (let s = 0; s < i.byteLength; s++)
2523
+ n += String.fromCharCode(i[s]);
2524
+ return Bt() ? btoa(n) : Buffer.from(n, "binary").toString("base64");
2525
+ }
2526
+ class zt {
2455
2527
  constructor(i) {
2456
2528
  this.UID = i;
2457
2529
  }
2458
2530
  }
2459
- const _t = 9783072e5, V = 100 * 1e3 * 1e3, Lt = 32768;
2460
- function et(g, i, n) {
2461
- return new DataView(g, i, n);
2531
+ const Xt = 9783072e5, X = 100 * 1e3 * 1e3, Vt = 32768;
2532
+ function et(f, i, n) {
2533
+ return new DataView(f, i, n);
2462
2534
  }
2463
- function $(g, i = 0) {
2535
+ function j(f, i = 0) {
2464
2536
  let n = 0;
2465
- for (let a = i; a < g.length; a++)
2466
- n <<= 8, n |= g[a] & 255;
2537
+ for (let s = i; s < f.length; s++)
2538
+ n <<= 8, n |= f[s] & 255;
2467
2539
  return n;
2468
2540
  }
2469
- function tt(g, i) {
2470
- return et(g, i, 8).getUint32(4, !1);
2541
+ function tt(f, i) {
2542
+ return et(f, i, 8).getUint32(4, !1);
2471
2543
  }
2472
- function kt(g) {
2473
- const i = g.length;
2544
+ function $t(f) {
2545
+ const i = f.length;
2474
2546
  for (let n = 0; n < i; n += 2) {
2475
- const a = g[n];
2476
- g[n] = g[n + 1], g[n + 1] = a;
2547
+ const s = f[n];
2548
+ f[n] = f[n + 1], f[n + 1] = s;
2477
2549
  }
2478
- return g;
2550
+ return f;
2479
2551
  }
2480
- function Rt(g) {
2552
+ function Yt(f) {
2481
2553
  let i = "", n;
2482
- for (n = 0; n < g.length && g[n] === 0; n++)
2554
+ for (n = 0; n < f.length && f[n] === 0; n++)
2483
2555
  ;
2484
- for (; n < g.length; n++) {
2485
- const a = "00" + g[n].toString(16);
2486
- i += a.substring(a.length - 2);
2556
+ for (; n < f.length; n++) {
2557
+ const s = "00" + f[n].toString(16);
2558
+ i += s.substring(s.length - 2);
2487
2559
  }
2488
2560
  return i;
2489
2561
  }
2490
- function Ct(g) {
2562
+ function ht(f) {
2491
2563
  try {
2492
- return Ot(g);
2564
+ return jt(f);
2493
2565
  } catch (i) {
2494
- return B(i);
2566
+ return P(i);
2495
2567
  }
2496
2568
  }
2497
- function Ot(g) {
2498
- const i = new Uint8Array(g), n = i.slice(0, 6);
2569
+ function jt(f) {
2570
+ const i = new Uint8Array(f), n = i.slice(0, 6);
2499
2571
  if (new TextDecoder("utf8").decode(n) !== "bplist")
2500
2572
  throw new Error("Invalid binary plist. Expected 'bplist' at offset 0.");
2501
- const c = g.byteLength - 32, E = new DataView(g, c, 32), w = E.getUint8(6), y = E.getUint8(7), I = tt(g, c + 8), N = tt(g, c + 16), T = tt(g, c + 24);
2502
- if (I > Lt)
2573
+ const c = f.byteLength - 32, w = new DataView(f, c, 32), d = w.getUint8(6), E = w.getUint8(7), T = tt(f, c + 8), U = tt(f, c + 16), I = tt(f, c + 24);
2574
+ if (T > Vt)
2503
2575
  throw new Error("maxObjectCount exceeded");
2504
- const m = [];
2505
- for (let e = 0; e < I; e++) {
2506
- const r = i.slice(T + e * w, T + (e + 1) * w);
2507
- m[e] = $(r, 0);
2576
+ const v = [];
2577
+ for (let e = 0; e < T; e++) {
2578
+ const r = i.slice(I + e * d, I + (e + 1) * d);
2579
+ v[e] = j(r, 0);
2508
2580
  }
2509
2581
  function t(e) {
2510
- const r = m[e], s = i[r], o = (s & 240) >> 4, u = s & 15;
2582
+ const r = v[e], a = i[r], o = (a & 240) >> 4, u = a & 15;
2511
2583
  switch (o) {
2512
2584
  case 0:
2513
2585
  return l();
@@ -2518,17 +2590,17 @@ function Ot(g) {
2518
2590
  case 2:
2519
2591
  return S();
2520
2592
  case 3:
2521
- return A();
2593
+ return N();
2522
2594
  case 4:
2523
- return L();
2595
+ return _();
2524
2596
  case 5:
2525
- return _(!1);
2597
+ return L(!1);
2526
2598
  case 6:
2527
- return _(!0);
2599
+ return L(!0);
2528
2600
  case 10:
2529
- return d();
2601
+ return y();
2530
2602
  case 13:
2531
- return f();
2603
+ return g();
2532
2604
  default:
2533
2605
  throw new Error("Unhandled type 0x" + o.toString(16));
2534
2606
  }
@@ -2548,178 +2620,209 @@ function Ot(g) {
2548
2620
  }
2549
2621
  function p() {
2550
2622
  const h = Math.pow(2, u);
2551
- if (h < V) {
2623
+ if (h < X) {
2552
2624
  const b = i.slice(r + 1, r + 1 + h);
2553
2625
  if (h === 16) {
2554
- const v = Rt(b);
2555
- return BigInt("0x" + v);
2626
+ const m = Yt(b);
2627
+ return BigInt("0x" + m);
2556
2628
  }
2557
- return b.reduce((v, x) => (v <<= 8, v |= x & 255, v), 0);
2629
+ return b.reduce((m, x) => (m <<= 8, m |= x & 255, m), 0);
2558
2630
  }
2559
2631
  throw new Error(
2560
- "Too little heap space available! Wanted to read " + h + " bytes, but only " + V + " are available."
2632
+ "Too little heap space available! Wanted to read " + h + " bytes, but only " + X + " are available."
2561
2633
  );
2562
2634
  }
2563
2635
  function F() {
2564
2636
  const h = u + 1;
2565
- if (h < V)
2566
- return new At($(i.slice(r + 1, r + 1 + h)));
2637
+ if (h < X)
2638
+ return new zt(j(i.slice(r + 1, r + 1 + h)));
2567
2639
  throw new Error(
2568
- "Too little heap space available! Wanted to read " + h + " bytes, but only " + V + " are available."
2640
+ "Too little heap space available! Wanted to read " + h + " bytes, but only " + X + " are available."
2569
2641
  );
2570
2642
  }
2571
2643
  function S() {
2572
2644
  const h = Math.pow(2, u);
2573
- if (h < V) {
2574
- const b = et(g, r + 1, h);
2645
+ if (h < X) {
2646
+ const b = et(f, r + 1, h);
2575
2647
  if (h === 4)
2576
2648
  return b.getFloat32(0, !1);
2577
2649
  if (h === 8)
2578
2650
  return b.getFloat64(0, !1);
2579
2651
  } else
2580
2652
  throw new Error(
2581
- "Too little heap space available! Wanted to read " + h + " bytes, but only " + V + " are available."
2653
+ "Too little heap space available! Wanted to read " + h + " bytes, but only " + X + " are available."
2582
2654
  );
2583
2655
  return 0;
2584
2656
  }
2585
- function A() {
2586
- const b = et(g, r + 1, 8).getFloat64(0, !1);
2587
- return new Date(_t + 1e3 * b);
2657
+ function N() {
2658
+ const b = et(f, r + 1, 8).getFloat64(0, !1);
2659
+ return new Date(Xt + 1e3 * b);
2588
2660
  }
2589
- function L() {
2661
+ function _() {
2590
2662
  let h = 1, b = u;
2591
2663
  if (u === 15) {
2592
- const x = i[r + 1] & 15, U = Math.pow(2, x);
2593
- h = 2 + U, b = $(i.slice(r + 2, r + 2 + U));
2664
+ const x = i[r + 1] & 15, A = Math.pow(2, x);
2665
+ h = 2 + A, b = j(i.slice(r + 2, r + 2 + A));
2594
2666
  }
2595
- if (b < V)
2667
+ if (b < X)
2596
2668
  return i.slice(r + h, r + h + b);
2597
2669
  throw new Error(
2598
- "Too little heap space available! Wanted to read " + b + " bytes, but only " + V + " are available."
2670
+ "Too little heap space available! Wanted to read " + b + " bytes, but only " + X + " are available."
2599
2671
  );
2600
2672
  }
2601
- function _(h) {
2602
- let b = "utf8", v = u, x = 1;
2673
+ function L(h) {
2674
+ let b = "utf8", m = u, x = 1;
2603
2675
  if (u === 15) {
2604
2676
  const k = i[r + 1] & 15, O = Math.pow(2, k);
2605
- x = 2 + O, v = $(i.slice(r + 2, r + 2 + O));
2677
+ x = 2 + O, m = j(i.slice(r + 2, r + 2 + O));
2606
2678
  }
2607
- if (v *= h ? 2 : 1, v < V) {
2608
- let U = i.slice(r + x, r + x + v);
2679
+ if (m *= h ? 2 : 1, m < X) {
2680
+ let A = i.slice(r + x, r + x + m);
2609
2681
  if (h) {
2610
- const k = new Uint8Array(U);
2611
- U = kt(k), b = "utf-16le";
2682
+ const k = new Uint8Array(A);
2683
+ A = $t(k), b = "utf-16le";
2612
2684
  } else
2613
2685
  b = "utf8";
2614
- return new TextDecoder(b).decode(U);
2686
+ return new TextDecoder(b).decode(A);
2615
2687
  }
2616
2688
  throw new Error(
2617
- "Too little heap space available! Wanted to read " + v + " bytes, but only " + V + " are available."
2689
+ "Too little heap space available! Wanted to read " + m + " bytes, but only " + X + " are available."
2618
2690
  );
2619
2691
  }
2620
- function d() {
2692
+ function y() {
2621
2693
  let h = u, b = 1;
2622
2694
  if (u === 15) {
2623
- const U = i[r + 1] & 15, k = Math.pow(2, U);
2624
- b = 2 + k, h = $(i.slice(r + 2, r + 2 + k));
2695
+ const A = i[r + 1] & 15, k = Math.pow(2, A);
2696
+ b = 2 + k, h = j(i.slice(r + 2, r + 2 + k));
2625
2697
  }
2626
- if (h * y > V)
2698
+ if (h * E > X)
2627
2699
  throw new Error("Too little heap space available!");
2628
- const v = [];
2700
+ const m = [];
2629
2701
  for (let x = 0; x < h; x++) {
2630
- const U = $(
2631
- i.slice(r + b + x * y, r + b + (x + 1) * y)
2702
+ const A = j(
2703
+ i.slice(r + b + x * E, r + b + (x + 1) * E)
2632
2704
  );
2633
- v[x] = t(U);
2705
+ m[x] = t(A);
2634
2706
  }
2635
- return v;
2707
+ return m;
2636
2708
  }
2637
- function f() {
2709
+ function g() {
2638
2710
  let h = u, b = 1;
2639
2711
  if (u === 15) {
2640
- const U = i[r + 1] & 15, k = Math.pow(2, U);
2641
- b = 2 + k, h = $(i.slice(r + 2, r + 2 + k));
2712
+ const A = i[r + 1] & 15, k = Math.pow(2, A);
2713
+ b = 2 + k, h = j(i.slice(r + 2, r + 2 + k));
2642
2714
  }
2643
- if (h * 2 * y > V)
2715
+ if (h * 2 * E > X)
2644
2716
  throw new Error("Too little heap space available!");
2645
- const v = {};
2717
+ const m = {};
2646
2718
  for (let x = 0; x < h; x++) {
2647
- const U = $(
2648
- i.slice(r + b + x * y, r + b + (x + 1) * y)
2649
- ), k = $(
2719
+ const A = j(
2720
+ i.slice(r + b + x * E, r + b + (x + 1) * E)
2721
+ ), k = j(
2650
2722
  i.slice(
2651
- r + b + h * y + x * y,
2652
- r + b + h * y + (x + 1) * y
2723
+ r + b + h * E + x * E,
2724
+ r + b + h * E + (x + 1) * E
2653
2725
  )
2654
- ), O = t(U), R = t(k);
2655
- v[String(O)] = R;
2726
+ ), O = t(A), C = t(k);
2727
+ m[String(O)] = C;
2656
2728
  }
2657
- return v;
2729
+ return m;
2658
2730
  }
2659
2731
  }
2660
- return t(N);
2732
+ return t(U);
2661
2733
  }
2662
- async function Xt(g, i) {
2663
- const n = await J(g).catch(B);
2664
- if (n instanceof Error)
2665
- return new Error(`load IPA error: ${n.message}`);
2666
- const a = {
2667
- ...(i?.frameworks || []).reduce(
2668
- function(e, r) {
2669
- const s = r.replace(/\.framework/i, "");
2670
- return e[s] = new RegExp(`/frameworks\\/${s}\\.framework\\/[^/]+?\\.plist$`, "i"), e;
2671
- },
2672
- {}
2673
- ),
2674
- main: /payload\/[^/]+?.app\/info.plist$/i
2675
- }, c = {};
2676
- if (n.forEach((e, r) => {
2677
- for (const s in a)
2678
- if (!c[s] && a[s].test(e)) {
2679
- c[s] = r;
2680
- break;
2681
- }
2682
- }), !c.main)
2683
- return new Error("not found Info.plist file in IPA");
2684
- const E = {}, w = {};
2685
- if (await Promise.all([
2686
- ...Object.keys(c).map((e) => c[e]?.async("arraybuffer").then((r) => {
2687
- w[e] = Ct(r);
2688
- }).catch((r) => {
2689
- w[e] = B(r);
2690
- })),
2691
- ...(i?.files || []).map((e) => n.file(e)?.async("arraybuffer").then((r) => {
2692
- E[e] = r;
2693
- }).catch((r) => {
2694
- E[e] = B(r);
2695
- }))
2696
- ]), !w.main || w.main instanceof Error)
2697
- return new Error(`parse Info.plist error: ${w.main?.message || "unknown error"}`);
2698
- const { main: y, ...I } = w, N = {
2699
- package: "CFBundleIdentifier" in y ? Q(y.CFBundleIdentifier) : "",
2700
- versionCode: "CFBundleVersion" in y ? at(y.CFBundleVersion) : 0,
2701
- versionName: "CFBundleShortVersionString" in y ? Q(y.CFBundleShortVersionString) : "",
2702
- plist: y,
2703
- frameworks: I,
2704
- files: E
2705
- };
2706
- if (i?.ignoreIcon)
2707
- return N;
2708
- const T = Pt(y), m = n.filter(
2709
- T ? (e) => e.includes(T) : (e) => /\/icon[^.]*?\.png/i.test(e)
2710
- )[0];
2711
- if (!m)
2712
- return N;
2713
- const t = await m.async("base64").catch(B);
2714
- return t instanceof Error || (N.icon = rt(t)), N;
2734
+ const qt = rt.loadAsync;
2735
+ class Kt {
2736
+ zip;
2737
+ constructor(i) {
2738
+ this.zip = qt(i).catch(P);
2739
+ }
2740
+ /**
2741
+ * 解析应用 plist 信息
2742
+ */
2743
+ async parse(i) {
2744
+ const n = await this.zip;
2745
+ if (n instanceof Error)
2746
+ return new Error(`load IPA error: ${n.message}`);
2747
+ const s = n.filter((t) => /payload\/[^/]+?.app\/info.plist$/i.test(t))[0];
2748
+ if (!s)
2749
+ return new Error("not found Info.plist file in IPA");
2750
+ const c = await s.async("arraybuffer").catch(P);
2751
+ if (c instanceof Error)
2752
+ return new Error(`read Info.plist file error: ${c.message}`);
2753
+ const w = ht(c);
2754
+ if (w instanceof Error)
2755
+ return new Error(`parse Info.plist error: ${w.message}`);
2756
+ const d = {
2757
+ package: "CFBundleIdentifier" in w ? Q(w.CFBundleIdentifier) : "",
2758
+ versionCode: "CFBundleVersion" in w ? ct(w.CFBundleVersion) : 0,
2759
+ versionName: "CFBundleShortVersionString" in w ? Q(w.CFBundleShortVersionString) : "",
2760
+ plist: w
2761
+ };
2762
+ if (i?.ignoreIcon)
2763
+ return d;
2764
+ const E = Ht(w);
2765
+ if (d.iconPath = E, !d.iconPath)
2766
+ return d;
2767
+ const T = n.filter((t) => t.includes(E))[0];
2768
+ if (!T)
2769
+ return d;
2770
+ d.iconPath = T.name;
2771
+ const U = await T.async("arraybuffer").catch(P);
2772
+ if (U instanceof Error)
2773
+ return d;
2774
+ const I = Mt(U), v = Dt(I);
2775
+ return d.icon = it(v), d;
2776
+ }
2777
+ // async parseProvision() {
2778
+ // const zip = await this.zip;
2779
+ // if (zip instanceof Error) {
2780
+ // return zip;
2781
+ // }
2782
+ // // spell-checker:ignore mobileprovision
2783
+ // const provisionFile =
2784
+ // zip.filter((relativePath) => /payload\/[^/]+?.app\/embedded.mobileprovision$/i.test(relativePath))[0] || null;
2785
+ // if (!provisionFile) {
2786
+ // return new Error(`not found provision file in IPA`);
2787
+ // }
2788
+ // const provision = await provisionFile?.async("text").catch(formatError);
2789
+ // if (provision instanceof Error) {
2790
+ // return provision;
2791
+ // }
2792
+ // const firstIndex = provision.indexOf("<?xml");
2793
+ // const endIndex = provision.indexOf("</plist>");
2794
+ // const xmlContent = provision.slice(firstIndex, endIndex + 8);
2795
+ // // todo 解析 xml
2796
+ // return xmlContent;
2797
+ // }
2798
+ /**
2799
+ * 读取指定模块的 plist 信息
2800
+ */
2801
+ async parseFramework(i) {
2802
+ const n = await this.zip;
2803
+ if (n instanceof Error)
2804
+ return n;
2805
+ const s = i.replace(/\.framework/i, ""), c = new RegExp(`\\/frameworks\\/${s}\\.framework\\/[^/]+?\\.plist$`, "i"), w = n.file(c)[0];
2806
+ if (!w)
2807
+ return new Error(`not found ${i} plist file in IPA`);
2808
+ const d = await w.async("arraybuffer").catch(P);
2809
+ return d instanceof Error ? new Error(`read ${i} plist file error: ${d.message}`) : ht(d);
2810
+ }
2811
+ /**
2812
+ * 读取指定文件的内容
2813
+ */
2814
+ async readFile(i, n) {
2815
+ const s = await this.zip;
2816
+ return s instanceof Error ? new Error(`load file error: ${s.message}`) : await nt(s, i, n);
2817
+ }
2715
2818
  }
2716
- function Pt(g) {
2717
- return G(g, "CFBundleIcons") && G(g.CFBundleIcons, "CFBundlePrimaryIcon") && G(g.CFBundleIcons.CFBundlePrimaryIcon, "CFBundleIconFiles") && Array.isArray(g.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles) && g.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles.length ? Q(
2718
- g.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles[g.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles.length - 1]
2719
- ) : G(g, "CFBundleIconFiles") && Array.isArray(g.CFBundleIconFiles) && g.CFBundleIconFiles.length ? Q(g.CFBundleIconFiles[g.CFBundleIconFiles.length - 1]) : "";
2819
+ function Ht(f) {
2820
+ return W(f, "CFBundleIcons") && W(f.CFBundleIcons, "CFBundlePrimaryIcon") && W(f.CFBundleIcons.CFBundlePrimaryIcon, "CFBundleIconFiles") && Array.isArray(f.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles) && f.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles.length ? Q(
2821
+ f.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles[f.CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles.length - 1]
2822
+ ) : W(f, "CFBundleIconFiles") && Array.isArray(f.CFBundleIconFiles) && f.CFBundleIconFiles.length ? Q(f.CFBundleIconFiles[f.CFBundleIconFiles.length - 1]) : "";
2720
2823
  }
2721
2824
  export {
2722
- Dt as parseApk,
2723
- Mt as parseHosApp,
2724
- Xt as parseIpa
2825
+ Wt as AndroidAppParser,
2826
+ Gt as HosAppParser,
2827
+ Kt as IosAppParser
2725
2828
  };