locar-tiler 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- class C {
1
+ class N {
2
2
  static EARTH = 4007501668e-2;
3
3
  static HALF_EARTH = 2003750834e-2;
4
4
  }
@@ -13,15 +13,15 @@ class q {
13
13
  * @param {number} y - the y coordinate of the tile.
14
14
  * @param {number} z - the zoom of the tile.
15
15
  */
16
- constructor(e, t, s) {
17
- this.x = e, this.y = t, this.z = s;
16
+ constructor(e, t, n) {
17
+ this.x = e, this.y = t, this.z = n;
18
18
  }
19
19
  /**
20
20
  * Get the number of Spherical Mercator "metres" in a given tile.
21
21
  * @return {number} the number of Spherical Mercator "metres" in a given tile.
22
22
  */
23
23
  getMetresInTile() {
24
- return C.EARTH / Math.pow(2, this.z);
24
+ return N.EARTH / Math.pow(2, this.z);
25
25
  }
26
26
  /**
27
27
  * Get the bottom left coordinate of the tile.
@@ -29,7 +29,7 @@ class q {
29
29
  */
30
30
  getBottomLeft() {
31
31
  var e = this.getMetresInTile();
32
- return { e: this.x * e - C.HALF_EARTH, n: C.HALF_EARTH - (this.y + 1) * e };
32
+ return { e: this.x * e - N.HALF_EARTH, n: N.HALF_EARTH - (this.y + 1) * e };
33
33
  }
34
34
  /**
35
35
  * Get the top right coordinate of the tile.
@@ -46,6 +46,9 @@ class q {
46
46
  getIndex() {
47
47
  return `${this.z}/${this.x}/${this.y}`;
48
48
  }
49
+ toString() {
50
+ return this.getIndex();
51
+ }
49
52
  }
50
53
  class Ie {
51
54
  /**
@@ -62,20 +65,20 @@ class Ie {
62
65
  * @return {LonLat} the longitude/latitude.
63
66
  */
64
67
  unproject(e) {
65
- return { lon: this.#s(e[0]), lat: this.#i(e[1]) };
68
+ return { lon: this.#n(e[0]), lat: this.#i(e[1]) };
66
69
  }
67
70
  #e(e) {
68
- return e / 180 * C.HALF_EARTH;
71
+ return e / 180 * N.HALF_EARTH;
69
72
  }
70
73
  #t(e) {
71
74
  var t = Math.log(Math.tan((90 + e) * Math.PI / 360)) / (Math.PI / 180);
72
- return t * C.HALF_EARTH / 180;
75
+ return t * N.HALF_EARTH / 180;
73
76
  }
74
- #s(e) {
75
- return e / C.HALF_EARTH * 180;
77
+ #n(e) {
78
+ return e / N.HALF_EARTH * 180;
76
79
  }
77
80
  #i(e) {
78
- var t = e / C.HALF_EARTH * 180;
81
+ var t = e / N.HALF_EARTH * 180;
79
82
  return t = 180 / Math.PI * (2 * Math.atan(Math.exp(t * Math.PI / 180)) - Math.PI / 2), t;
80
83
  }
81
84
  /**
@@ -84,8 +87,8 @@ class Ie {
84
87
  * @param {number} z - the zoom level.
85
88
  */
86
89
  getTile(e, t) {
87
- var s = new q(-1, -1, t), a = s.getMetresInTile();
88
- return s.x = Math.floor((C.HALF_EARTH + e.e) / a), s.y = Math.floor((C.HALF_EARTH - e.n) / a), s;
90
+ var n = new q(-1, -1, t), a = n.getMetresInTile();
91
+ return n.x = Math.floor((N.HALF_EARTH + e.e) / a), n.y = Math.floor((N.HALF_EARTH - e.n) / a), n;
89
92
  }
90
93
  /**
91
94
  * Obtains a tile from a given lon/lat and zoom.
@@ -146,13 +149,13 @@ class ie {
146
149
  */
147
150
  async update(e) {
148
151
  const t = [];
149
- let s = null;
150
- if (s = this.#e(e)) {
151
- this.tile = s;
152
- const a = [s.x, s.x - 1, s.x + 1], n = [s.y, s.y - 1, s.y + 1];
152
+ let n = null;
153
+ if (n = this.#e(e)) {
154
+ this.tile = n;
155
+ const a = [n.x, n.x - 1, n.x + 1], s = [n.y, n.y - 1, n.y + 1];
153
156
  for (let l = 0; l < a.length; l++)
154
- for (let h = 0; h < n.length; h++) {
155
- const d = new q(a[l], n[h], s.z), r = await this.#t(d);
157
+ for (let h = 0; h < s.length; h++) {
158
+ const d = new q(a[l], s[h], n.z), r = await this.#t(d);
156
159
  r !== null && t.push({ data: r.data, tile: d });
157
160
  }
158
161
  }
@@ -171,10 +174,10 @@ class ie {
171
174
  * @return {DataTile[]} array of 9 tiles, including the current tile and the 8 surrounding it.
172
175
  */
173
176
  getCurrentTiles() {
174
- const e = [], t = [this.tile.x, this.tile.x - 1, this.tile.x + 1], s = [this.tile.y, this.tile.y - 1, this.tile.y + 1];
177
+ const e = [], t = [this.tile.x, this.tile.x - 1, this.tile.x + 1], n = [this.tile.y, this.tile.y - 1, this.tile.y + 1];
175
178
  for (let a = 0; a < t.length; a++)
176
- for (let n = 0; n < s.length; n++) {
177
- const l = new q(t[a], s[n], this.tile.z), h = this.dataTiles[l.getIndex()];
179
+ for (let s = 0; s < n.length; s++) {
180
+ const l = new q(t[a], n[s], this.tile.z), h = this.dataTiles.get(l.getIndex());
178
181
  h !== null && e.push({ data: h, tile: l });
179
182
  }
180
183
  return e;
@@ -188,11 +191,11 @@ class ie {
188
191
  }
189
192
  async #t(e) {
190
193
  const t = e.getIndex();
191
- if (this.dataTiles[t] === void 0) {
192
- const s = await this.readTile(
194
+ if (this.dataTiles.get(t) === void 0) {
195
+ const n = await this.readTile(
193
196
  this.url.replace("{x}", e.x.toString()).replace("{y}", e.y.toString()).replace("{z}", e.z.toString())
194
197
  );
195
- return this.dataTiles[t] = this.rawTileToStoredTile(e, s), this.dataTiles[t];
198
+ return this.dataTiles.set(t, this.rawTileToStoredTile(e, n)), this.dataTiles.get(t);
196
199
  }
197
200
  return null;
198
201
  }
@@ -204,8 +207,8 @@ class ie {
204
207
  */
205
208
  async getData(e, t = 13) {
206
209
  await this.update(e);
207
- const s = this.sphMerc.getTile(e, t);
208
- return this.dataTiles[`${t}/${s.x}/${s.y}`];
210
+ const n = this.sphMerc.getTile(e, t);
211
+ return this.dataTiles.get(`${t}/${n.x}/${n.y}`);
209
212
  }
210
213
  /**
211
214
  * Converts the raw data from the server to a custom type of data.
@@ -222,10 +225,10 @@ function bt(i, e = "utf8") {
222
225
  return new TextDecoder(e).decode(i);
223
226
  }
224
227
  const Oe = new TextEncoder();
225
- function Re(i) {
228
+ function Se(i) {
226
229
  return Oe.encode(i);
227
230
  }
228
- const Se = 1024 * 8, Ne = (() => {
231
+ const Re = 1024 * 8, Ce = (() => {
229
232
  const i = new Uint8Array(4), e = new Uint32Array(i.buffer);
230
233
  return !((e[0] = 1) & i[0]);
231
234
  })(), et = {
@@ -276,12 +279,12 @@ class wt {
276
279
  * @param options - An object for the options.
277
280
  * @returns A new IOBuffer instance.
278
281
  */
279
- constructor(e = Se, t = {}) {
280
- let s = !1;
281
- typeof e == "number" ? e = new ArrayBuffer(e) : (s = !0, this.lastWrittenByte = e.byteLength);
282
- const a = t.offset ? t.offset >>> 0 : 0, n = e.byteLength - a;
282
+ constructor(e = Re, t = {}) {
283
+ let n = !1;
284
+ typeof e == "number" ? e = new ArrayBuffer(e) : (n = !0, this.lastWrittenByte = e.byteLength);
285
+ const a = t.offset ? t.offset >>> 0 : 0, s = e.byteLength - a;
283
286
  let l = a;
284
- (ArrayBuffer.isView(e) || e instanceof wt) && (e.byteLength !== e.buffer.byteLength && (l = e.byteOffset + a), e = e.buffer), s ? this.lastWrittenByte = n : this.lastWrittenByte = 0, this.buffer = e, this.length = n, this.byteLength = n, this.byteOffset = l, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, l, n), this._mark = 0, this._marks = [];
287
+ (ArrayBuffer.isView(e) || e instanceof wt) && (e.byteLength !== e.buffer.byteLength && (l = e.byteOffset + a), e = e.buffer), n ? this.lastWrittenByte = s : this.lastWrittenByte = 0, this.buffer = e, this.length = s, this.byteLength = s, this.byteOffset = l, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, l, s), this._mark = 0, this._marks = [];
285
288
  }
286
289
  /**
287
290
  * Checks if the memory allocated to the buffer is sufficient to store more
@@ -398,8 +401,8 @@ class wt {
398
401
  */
399
402
  ensureAvailable(e = 1) {
400
403
  if (!this.available(e)) {
401
- const s = (this.offset + e) * 2, a = new Uint8Array(s);
402
- a.set(new Uint8Array(this.buffer)), this.buffer = a.buffer, this.length = s, this.byteLength = s, this._data = new DataView(this.buffer);
404
+ const n = (this.offset + e) * 2, a = new Uint8Array(n);
405
+ a.set(new Uint8Array(this.buffer)), this.buffer = a.buffer, this.length = n, this.byteLength = n, this._data = new DataView(this.buffer);
403
406
  }
404
407
  return this;
405
408
  }
@@ -448,15 +451,15 @@ class wt {
448
451
  * @returns The read array.
449
452
  */
450
453
  readArray(e, t) {
451
- const s = et[t].BYTES_PER_ELEMENT * e, a = this.byteOffset + this.offset, n = this.buffer.slice(a, a + s);
452
- if (this.littleEndian === Ne && t !== "uint8" && t !== "int8") {
453
- const h = new Uint8Array(this.buffer.slice(a, a + s));
454
+ const n = et[t].BYTES_PER_ELEMENT * e, a = this.byteOffset + this.offset, s = this.buffer.slice(a, a + n);
455
+ if (this.littleEndian === Ce && t !== "uint8" && t !== "int8") {
456
+ const h = new Uint8Array(this.buffer.slice(a, a + n));
454
457
  h.reverse();
455
458
  const d = new et[t](h.buffer);
456
- return this.offset += s, d.reverse(), d;
459
+ return this.offset += n, d.reverse(), d;
457
460
  }
458
- const l = new et[t](n);
459
- return this.offset += s, l;
461
+ const l = new et[t](s);
462
+ return this.offset += n, l;
460
463
  }
461
464
  /**
462
465
  * Read a 16-bit signed integer and move pointer forward by 2 bytes.
@@ -536,7 +539,7 @@ class wt {
536
539
  */
537
540
  readChars(e = 1) {
538
541
  let t = "";
539
- for (let s = 0; s < e; s++)
542
+ for (let n = 0; n < e; n++)
540
543
  t += this.readChar();
541
544
  return t;
542
545
  }
@@ -705,7 +708,7 @@ class wt {
705
708
  * @returns This.
706
709
  */
707
710
  writeUtf8(e) {
708
- return this.writeBytes(Re(e));
711
+ return this.writeBytes(Se(e));
709
712
  }
710
713
  /**
711
714
  * Export a Uint8Array view of the internal buffer.
@@ -736,47 +739,47 @@ function F(i) {
736
739
  for (; --e >= 0; )
737
740
  i[e] = 0;
738
741
  }
739
- const Ce = 3, De = 258, se = 29, Me = 256, Le = Me + 1 + se, ne = 30, Be = 512, $e = new Array((Le + 2) * 2);
742
+ const Ne = 3, De = 258, ne = 29, Me = 256, Le = Me + 1 + ne, se = 30, Be = 512, $e = new Array((Le + 2) * 2);
740
743
  F($e);
741
- const Fe = new Array(ne * 2);
744
+ const Fe = new Array(se * 2);
742
745
  F(Fe);
743
746
  const He = new Array(Be);
744
747
  F(He);
745
- const Ze = new Array(De - Ce + 1);
748
+ const Ze = new Array(De - Ne + 1);
746
749
  F(Ze);
747
- const We = new Array(se);
750
+ const We = new Array(ne);
748
751
  F(We);
749
- const ze = new Array(ne);
752
+ const ze = new Array(se);
750
753
  F(ze);
751
- const Pe = (i, e, t, s) => {
752
- let a = i & 65535 | 0, n = i >>> 16 & 65535 | 0, l = 0;
754
+ const Pe = (i, e, t, n) => {
755
+ let a = i & 65535 | 0, s = i >>> 16 & 65535 | 0, l = 0;
753
756
  for (; t !== 0; ) {
754
757
  l = t > 2e3 ? 2e3 : t, t -= l;
755
758
  do
756
- a = a + e[s++] | 0, n = n + a | 0;
759
+ a = a + e[n++] | 0, s = s + a | 0;
757
760
  while (--l);
758
- a %= 65521, n %= 65521;
761
+ a %= 65521, s %= 65521;
759
762
  }
760
- return a | n << 16 | 0;
763
+ return a | s << 16 | 0;
761
764
  };
762
765
  var ut = Pe;
763
766
  const Ge = () => {
764
767
  let i, e = [];
765
768
  for (var t = 0; t < 256; t++) {
766
769
  i = t;
767
- for (var s = 0; s < 8; s++)
770
+ for (var n = 0; n < 8; n++)
768
771
  i = i & 1 ? 3988292384 ^ i >>> 1 : i >>> 1;
769
772
  e[t] = i;
770
773
  }
771
774
  return e;
772
- }, Ye = new Uint32Array(Ge()), Ke = (i, e, t, s) => {
773
- const a = Ye, n = s + t;
775
+ }, Ke = new Uint32Array(Ge()), Ye = (i, e, t, n) => {
776
+ const a = Ke, s = n + t;
774
777
  i ^= -1;
775
- for (let l = s; l < n; l++)
778
+ for (let l = n; l < s; l++)
776
779
  i = i >>> 8 ^ a[(i ^ e[l]) & 255];
777
780
  return i ^ -1;
778
781
  };
779
- var S = Ke, _t = {
782
+ var R = Ye, _t = {
780
783
  2: "need dictionary",
781
784
  /* Z_NEED_DICT 2 */
782
785
  1: "stream end",
@@ -823,18 +826,18 @@ var Xe = function(i) {
823
826
  if (t) {
824
827
  if (typeof t != "object")
825
828
  throw new TypeError(t + "must be non-object");
826
- for (const s in t)
827
- je(t, s) && (i[s] = t[s]);
829
+ for (const n in t)
830
+ je(t, n) && (i[n] = t[n]);
828
831
  }
829
832
  }
830
833
  return i;
831
834
  }, Ve = (i) => {
832
835
  let e = 0;
833
- for (let s = 0, a = i.length; s < a; s++)
834
- e += i[s].length;
836
+ for (let n = 0, a = i.length; n < a; n++)
837
+ e += i[n].length;
835
838
  const t = new Uint8Array(e);
836
- for (let s = 0, a = 0, n = i.length; s < n; s++) {
837
- let l = i[s];
839
+ for (let n = 0, a = 0, s = i.length; n < s; n++) {
840
+ let l = i[n];
838
841
  t.set(l, a), a += l.length;
839
842
  }
840
843
  return t;
@@ -855,47 +858,47 @@ Z[254] = Z[254] = 1;
855
858
  var qe = (i) => {
856
859
  if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
857
860
  return new TextEncoder().encode(i);
858
- let e, t, s, a, n, l = i.length, h = 0;
861
+ let e, t, n, a, s, l = i.length, h = 0;
859
862
  for (a = 0; a < l; a++)
860
- t = i.charCodeAt(a), (t & 64512) === 55296 && a + 1 < l && (s = i.charCodeAt(a + 1), (s & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (s - 56320), a++)), h += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
861
- for (e = new Uint8Array(h), n = 0, a = 0; n < h; a++)
862
- t = i.charCodeAt(a), (t & 64512) === 55296 && a + 1 < l && (s = i.charCodeAt(a + 1), (s & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (s - 56320), a++)), t < 128 ? e[n++] = t : t < 2048 ? (e[n++] = 192 | t >>> 6, e[n++] = 128 | t & 63) : t < 65536 ? (e[n++] = 224 | t >>> 12, e[n++] = 128 | t >>> 6 & 63, e[n++] = 128 | t & 63) : (e[n++] = 240 | t >>> 18, e[n++] = 128 | t >>> 12 & 63, e[n++] = 128 | t >>> 6 & 63, e[n++] = 128 | t & 63);
863
+ t = i.charCodeAt(a), (t & 64512) === 55296 && a + 1 < l && (n = i.charCodeAt(a + 1), (n & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (n - 56320), a++)), h += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
864
+ for (e = new Uint8Array(h), s = 0, a = 0; s < h; a++)
865
+ t = i.charCodeAt(a), (t & 64512) === 55296 && a + 1 < l && (n = i.charCodeAt(a + 1), (n & 64512) === 56320 && (t = 65536 + (t - 55296 << 10) + (n - 56320), a++)), t < 128 ? e[s++] = t : t < 2048 ? (e[s++] = 192 | t >>> 6, e[s++] = 128 | t & 63) : t < 65536 ? (e[s++] = 224 | t >>> 12, e[s++] = 128 | t >>> 6 & 63, e[s++] = 128 | t & 63) : (e[s++] = 240 | t >>> 18, e[s++] = 128 | t >>> 12 & 63, e[s++] = 128 | t >>> 6 & 63, e[s++] = 128 | t & 63);
863
866
  return e;
864
867
  };
865
868
  const Je = (i, e) => {
866
869
  if (e < 65534 && i.subarray && oe)
867
870
  return String.fromCharCode.apply(null, i.length === e ? i : i.subarray(0, e));
868
871
  let t = "";
869
- for (let s = 0; s < e; s++)
870
- t += String.fromCharCode(i[s]);
872
+ for (let n = 0; n < e; n++)
873
+ t += String.fromCharCode(i[n]);
871
874
  return t;
872
875
  };
873
876
  var Qe = (i, e) => {
874
877
  const t = e || i.length;
875
878
  if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
876
879
  return new TextDecoder().decode(i.subarray(0, e));
877
- let s, a;
878
- const n = new Array(t * 2);
879
- for (a = 0, s = 0; s < t; ) {
880
- let l = i[s++];
880
+ let n, a;
881
+ const s = new Array(t * 2);
882
+ for (a = 0, n = 0; n < t; ) {
883
+ let l = i[n++];
881
884
  if (l < 128) {
882
- n[a++] = l;
885
+ s[a++] = l;
883
886
  continue;
884
887
  }
885
888
  let h = Z[l];
886
889
  if (h > 4) {
887
- n[a++] = 65533, s += h - 1;
890
+ s[a++] = 65533, n += h - 1;
888
891
  continue;
889
892
  }
890
- for (l &= h === 2 ? 31 : h === 3 ? 15 : 7; h > 1 && s < t; )
891
- l = l << 6 | i[s++] & 63, h--;
893
+ for (l &= h === 2 ? 31 : h === 3 ? 15 : 7; h > 1 && n < t; )
894
+ l = l << 6 | i[n++] & 63, h--;
892
895
  if (h > 1) {
893
- n[a++] = 65533;
896
+ s[a++] = 65533;
894
897
  continue;
895
898
  }
896
- l < 65536 ? n[a++] = l : (l -= 65536, n[a++] = 55296 | l >> 10 & 1023, n[a++] = 56320 | l & 1023);
899
+ l < 65536 ? s[a++] = l : (l -= 65536, s[a++] = 55296 | l >> 10 & 1023, s[a++] = 56320 | l & 1023);
897
900
  }
898
- return Je(n, a);
901
+ return Je(s, a);
899
902
  }, ti = (i, e) => {
900
903
  e = e || i.length, e > i.length && (e = i.length);
901
904
  let t = e - 1;
@@ -911,76 +914,76 @@ function ei() {
911
914
  this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
912
915
  }
913
916
  var ii = ei;
914
- const Y = 16209, si = 16191;
915
- var ni = function(e, t) {
916
- let s, a, n, l, h, d, r, o, w, u, f, _, U, x, g, T, y, c, k, I, p, m, A, b;
917
- const E = e.state;
918
- s = e.next_in, A = e.input, a = s + (e.avail_in - 5), n = e.next_out, b = e.output, l = n - (t - e.avail_out), h = n + (e.avail_out - 257), d = E.dmax, r = E.wsize, o = E.whave, w = E.wnext, u = E.window, f = E.hold, _ = E.bits, U = E.lencode, x = E.distcode, g = (1 << E.lenbits) - 1, T = (1 << E.distbits) - 1;
917
+ const K = 16209, ni = 16191;
918
+ var si = function(e, t) {
919
+ let n, a, s, l, h, d, r, o, w, u, f, _, U, x, g, T, y, c, E, I, p, m, A, b;
920
+ const k = e.state;
921
+ n = e.next_in, A = e.input, a = n + (e.avail_in - 5), s = e.next_out, b = e.output, l = s - (t - e.avail_out), h = s + (e.avail_out - 257), d = k.dmax, r = k.wsize, o = k.whave, w = k.wnext, u = k.window, f = k.hold, _ = k.bits, U = k.lencode, x = k.distcode, g = (1 << k.lenbits) - 1, T = (1 << k.distbits) - 1;
919
922
  t:
920
923
  do {
921
- _ < 15 && (f += A[s++] << _, _ += 8, f += A[s++] << _, _ += 8), y = U[f & g];
924
+ _ < 15 && (f += A[n++] << _, _ += 8, f += A[n++] << _, _ += 8), y = U[f & g];
922
925
  e:
923
926
  for (; ; ) {
924
927
  if (c = y >>> 24, f >>>= c, _ -= c, c = y >>> 16 & 255, c === 0)
925
- b[n++] = y & 65535;
928
+ b[s++] = y & 65535;
926
929
  else if (c & 16) {
927
- k = y & 65535, c &= 15, c && (_ < c && (f += A[s++] << _, _ += 8), k += f & (1 << c) - 1, f >>>= c, _ -= c), _ < 15 && (f += A[s++] << _, _ += 8, f += A[s++] << _, _ += 8), y = x[f & T];
930
+ E = y & 65535, c &= 15, c && (_ < c && (f += A[n++] << _, _ += 8), E += f & (1 << c) - 1, f >>>= c, _ -= c), _ < 15 && (f += A[n++] << _, _ += 8, f += A[n++] << _, _ += 8), y = x[f & T];
928
931
  i:
929
932
  for (; ; ) {
930
933
  if (c = y >>> 24, f >>>= c, _ -= c, c = y >>> 16 & 255, c & 16) {
931
- if (I = y & 65535, c &= 15, _ < c && (f += A[s++] << _, _ += 8, _ < c && (f += A[s++] << _, _ += 8)), I += f & (1 << c) - 1, I > d) {
932
- e.msg = "invalid distance too far back", E.mode = Y;
934
+ if (I = y & 65535, c &= 15, _ < c && (f += A[n++] << _, _ += 8, _ < c && (f += A[n++] << _, _ += 8)), I += f & (1 << c) - 1, I > d) {
935
+ e.msg = "invalid distance too far back", k.mode = K;
933
936
  break t;
934
937
  }
935
- if (f >>>= c, _ -= c, c = n - l, I > c) {
936
- if (c = I - c, c > o && E.sane) {
937
- e.msg = "invalid distance too far back", E.mode = Y;
938
+ if (f >>>= c, _ -= c, c = s - l, I > c) {
939
+ if (c = I - c, c > o && k.sane) {
940
+ e.msg = "invalid distance too far back", k.mode = K;
938
941
  break t;
939
942
  }
940
943
  if (p = 0, m = u, w === 0) {
941
- if (p += r - c, c < k) {
942
- k -= c;
944
+ if (p += r - c, c < E) {
945
+ E -= c;
943
946
  do
944
- b[n++] = u[p++];
947
+ b[s++] = u[p++];
945
948
  while (--c);
946
- p = n - I, m = b;
949
+ p = s - I, m = b;
947
950
  }
948
951
  } else if (w < c) {
949
- if (p += r + w - c, c -= w, c < k) {
950
- k -= c;
952
+ if (p += r + w - c, c -= w, c < E) {
953
+ E -= c;
951
954
  do
952
- b[n++] = u[p++];
955
+ b[s++] = u[p++];
953
956
  while (--c);
954
- if (p = 0, w < k) {
955
- c = w, k -= c;
957
+ if (p = 0, w < E) {
958
+ c = w, E -= c;
956
959
  do
957
- b[n++] = u[p++];
960
+ b[s++] = u[p++];
958
961
  while (--c);
959
- p = n - I, m = b;
962
+ p = s - I, m = b;
960
963
  }
961
964
  }
962
- } else if (p += w - c, c < k) {
963
- k -= c;
965
+ } else if (p += w - c, c < E) {
966
+ E -= c;
964
967
  do
965
- b[n++] = u[p++];
968
+ b[s++] = u[p++];
966
969
  while (--c);
967
- p = n - I, m = b;
970
+ p = s - I, m = b;
968
971
  }
969
- for (; k > 2; )
970
- b[n++] = m[p++], b[n++] = m[p++], b[n++] = m[p++], k -= 3;
971
- k && (b[n++] = m[p++], k > 1 && (b[n++] = m[p++]));
972
+ for (; E > 2; )
973
+ b[s++] = m[p++], b[s++] = m[p++], b[s++] = m[p++], E -= 3;
974
+ E && (b[s++] = m[p++], E > 1 && (b[s++] = m[p++]));
972
975
  } else {
973
- p = n - I;
976
+ p = s - I;
974
977
  do
975
- b[n++] = b[p++], b[n++] = b[p++], b[n++] = b[p++], k -= 3;
976
- while (k > 2);
977
- k && (b[n++] = b[p++], k > 1 && (b[n++] = b[p++]));
978
+ b[s++] = b[p++], b[s++] = b[p++], b[s++] = b[p++], E -= 3;
979
+ while (E > 2);
980
+ E && (b[s++] = b[p++], E > 1 && (b[s++] = b[p++]));
978
981
  }
979
982
  } else if ((c & 64) === 0) {
980
983
  y = x[(y & 65535) + (f & (1 << c) - 1)];
981
984
  continue i;
982
985
  } else {
983
- e.msg = "invalid distance code", E.mode = Y;
986
+ e.msg = "invalid distance code", k.mode = K;
984
987
  break t;
985
988
  }
986
989
  break;
@@ -989,18 +992,18 @@ var ni = function(e, t) {
989
992
  y = U[(y & 65535) + (f & (1 << c) - 1)];
990
993
  continue e;
991
994
  } else if (c & 32) {
992
- E.mode = si;
995
+ k.mode = ni;
993
996
  break t;
994
997
  } else {
995
- e.msg = "invalid literal/length code", E.mode = Y;
998
+ e.msg = "invalid literal/length code", k.mode = K;
996
999
  break t;
997
1000
  }
998
1001
  break;
999
1002
  }
1000
- } while (s < a && n < h);
1001
- k = _ >> 3, s -= k, _ -= k << 3, f &= (1 << _) - 1, e.next_in = s, e.next_out = n, e.avail_in = s < a ? 5 + (a - s) : 5 - (s - a), e.avail_out = n < h ? 257 + (h - n) : 257 - (n - h), E.hold = f, E.bits = _;
1003
+ } while (n < a && s < h);
1004
+ E = _ >> 3, n -= E, _ -= E << 3, f &= (1 << _) - 1, e.next_in = n, e.next_out = s, e.avail_in = n < a ? 5 + (a - n) : 5 - (n - a), e.avail_out = s < h ? 257 + (h - s) : 257 - (s - h), k.hold = f, k.bits = _;
1002
1005
  };
1003
- const $ = 15, xt = 852, yt = 592, Et = 0, it = 1, kt = 2, ai = new Uint16Array([
1006
+ const $ = 15, xt = 852, yt = 592, kt = 0, it = 1, Et = 2, ai = new Uint16Array([
1004
1007
  /* Length codes 257..285 base */
1005
1008
  3,
1006
1009
  4,
@@ -1134,31 +1137,31 @@ const $ = 15, xt = 852, yt = 592, Et = 0, it = 1, kt = 2, ai = new Uint16Array([
1134
1137
  29,
1135
1138
  64,
1136
1139
  64
1137
- ]), li = (i, e, t, s, a, n, l, h) => {
1140
+ ]), li = (i, e, t, n, a, s, l, h) => {
1138
1141
  const d = h.bits;
1139
- let r = 0, o = 0, w = 0, u = 0, f = 0, _ = 0, U = 0, x = 0, g = 0, T = 0, y, c, k, I, p, m = null, A;
1140
- const b = new Uint16Array($ + 1), E = new Uint16Array($ + 1);
1142
+ let r = 0, o = 0, w = 0, u = 0, f = 0, _ = 0, U = 0, x = 0, g = 0, T = 0, y, c, E, I, p, m = null, A;
1143
+ const b = new Uint16Array($ + 1), k = new Uint16Array($ + 1);
1141
1144
  let M = null, gt, P, G;
1142
1145
  for (r = 0; r <= $; r++)
1143
1146
  b[r] = 0;
1144
- for (o = 0; o < s; o++)
1147
+ for (o = 0; o < n; o++)
1145
1148
  b[e[t + o]]++;
1146
1149
  for (f = d, u = $; u >= 1 && b[u] === 0; u--)
1147
1150
  ;
1148
1151
  if (f > u && (f = u), u === 0)
1149
- return a[n++] = 1 << 24 | 64 << 16 | 0, a[n++] = 1 << 24 | 64 << 16 | 0, h.bits = 1, 0;
1152
+ return a[s++] = 1 << 24 | 64 << 16 | 0, a[s++] = 1 << 24 | 64 << 16 | 0, h.bits = 1, 0;
1150
1153
  for (w = 1; w < u && b[w] === 0; w++)
1151
1154
  ;
1152
1155
  for (f < w && (f = w), x = 1, r = 1; r <= $; r++)
1153
1156
  if (x <<= 1, x -= b[r], x < 0)
1154
1157
  return -1;
1155
- if (x > 0 && (i === Et || u !== 1))
1158
+ if (x > 0 && (i === kt || u !== 1))
1156
1159
  return -1;
1157
- for (E[1] = 0, r = 1; r < $; r++)
1158
- E[r + 1] = E[r] + b[r];
1159
- for (o = 0; o < s; o++)
1160
- e[t + o] !== 0 && (l[E[e[t + o]]++] = o);
1161
- if (i === Et ? (m = M = l, A = 20) : i === it ? (m = ai, M = ri, A = 257) : (m = oi, M = hi, A = 0), T = 0, o = 0, r = w, p = n, _ = f, U = 0, k = -1, g = 1 << f, I = g - 1, i === it && g > xt || i === kt && g > yt)
1160
+ for (k[1] = 0, r = 1; r < $; r++)
1161
+ k[r + 1] = k[r] + b[r];
1162
+ for (o = 0; o < n; o++)
1163
+ e[t + o] !== 0 && (l[k[e[t + o]]++] = o);
1164
+ if (i === kt ? (m = M = l, A = 20) : i === it ? (m = ai, M = ri, A = 257) : (m = oi, M = hi, A = 0), T = 0, o = 0, r = w, p = s, _ = f, U = 0, E = -1, g = 1 << f, I = g - 1, i === it && g > xt || i === Et && g > yt)
1162
1165
  return 1;
1163
1166
  for (; ; ) {
1164
1167
  gt = r - U, l[o] + 1 < A ? (P = 0, G = l[o]) : l[o] >= A ? (P = M[l[o] - A], G = m[l[o] - A]) : (P = 96, G = 0), y = 1 << r - U, c = 1 << _, w = c;
@@ -1172,12 +1175,12 @@ const $ = 15, xt = 852, yt = 592, Et = 0, it = 1, kt = 2, ai = new Uint16Array([
1172
1175
  break;
1173
1176
  r = e[t + l[o]];
1174
1177
  }
1175
- if (r > f && (T & I) !== k) {
1178
+ if (r > f && (T & I) !== E) {
1176
1179
  for (U === 0 && (U = f), p += w, _ = r - U, x = 1 << _; _ + U < u && (x -= b[_ + U], !(x <= 0)); )
1177
1180
  _++, x <<= 1;
1178
- if (g += 1 << _, i === it && g > xt || i === kt && g > yt)
1181
+ if (g += 1 << _, i === it && g > xt || i === Et && g > yt)
1179
1182
  return 1;
1180
- k = T & I, a[k] = f << 24 | _ << 16 | p - n | 0;
1183
+ E = T & I, a[E] = f << 24 | _ << 16 | p - s | 0;
1181
1184
  }
1182
1185
  }
1183
1186
  return T !== 0 && (a[p + T] = r - U << 24 | 64 << 16 | 0), h.bits = f, 0;
@@ -1186,16 +1189,16 @@ var H = li;
1186
1189
  const fi = 0, he = 1, le = 2, {
1187
1190
  Z_FINISH: At,
1188
1191
  Z_BLOCK: ci,
1189
- Z_TREES: K,
1192
+ Z_TREES: Y,
1190
1193
  Z_OK: L,
1191
1194
  Z_STREAM_END: di,
1192
1195
  Z_NEED_DICT: ui,
1193
- Z_STREAM_ERROR: R,
1196
+ Z_STREAM_ERROR: S,
1194
1197
  Z_DATA_ERROR: fe,
1195
1198
  Z_MEM_ERROR: ce,
1196
1199
  Z_BUF_ERROR: _i,
1197
1200
  Z_DEFLATED: Tt
1198
- } = ae, tt = 16180, mt = 16181, vt = 16182, Ut = 16183, It = 16184, Ot = 16185, Rt = 16186, St = 16187, Nt = 16188, Ct = 16189, Q = 16190, N = 16191, st = 16192, Dt = 16193, nt = 16194, Mt = 16195, Lt = 16196, Bt = 16197, $t = 16198, j = 16199, X = 16200, Ft = 16201, Ht = 16202, Zt = 16203, Wt = 16204, zt = 16205, at = 16206, Pt = 16207, Gt = 16208, v = 16209, de = 16210, ue = 16211, pi = 852, wi = 592, gi = 15, bi = gi, Yt = (i) => (i >>> 24 & 255) + (i >>> 8 & 65280) + ((i & 65280) << 8) + ((i & 255) << 24);
1201
+ } = ae, tt = 16180, mt = 16181, vt = 16182, Ut = 16183, It = 16184, Ot = 16185, St = 16186, Rt = 16187, Ct = 16188, Nt = 16189, Q = 16190, C = 16191, nt = 16192, Dt = 16193, st = 16194, Mt = 16195, Lt = 16196, Bt = 16197, $t = 16198, j = 16199, X = 16200, Ft = 16201, Ht = 16202, Zt = 16203, Wt = 16204, zt = 16205, at = 16206, Pt = 16207, Gt = 16208, v = 16209, de = 16210, ue = 16211, pi = 852, wi = 592, gi = 15, bi = gi, Kt = (i) => (i >>> 24 & 255) + (i >>> 8 & 65280) + ((i & 65280) << 8) + ((i & 255) << 24);
1199
1202
  function xi() {
1200
1203
  this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
1201
1204
  }
@@ -1206,31 +1209,31 @@ const B = (i) => {
1206
1209
  return !e || e.strm !== i || e.mode < tt || e.mode > ue ? 1 : 0;
1207
1210
  }, _e = (i) => {
1208
1211
  if (B(i))
1209
- return R;
1212
+ return S;
1210
1213
  const e = i.state;
1211
1214
  return i.total_in = i.total_out = e.total = 0, i.msg = "", e.wrap && (i.adler = e.wrap & 1), e.mode = tt, e.last = 0, e.havedict = 0, e.flags = -1, e.dmax = 32768, e.head = null, e.hold = 0, e.bits = 0, e.lencode = e.lendyn = new Int32Array(pi), e.distcode = e.distdyn = new Int32Array(wi), e.sane = 1, e.back = -1, L;
1212
1215
  }, pe = (i) => {
1213
1216
  if (B(i))
1214
- return R;
1217
+ return S;
1215
1218
  const e = i.state;
1216
1219
  return e.wsize = 0, e.whave = 0, e.wnext = 0, _e(i);
1217
1220
  }, we = (i, e) => {
1218
1221
  let t;
1219
1222
  if (B(i))
1220
- return R;
1221
- const s = i.state;
1222
- return e < 0 ? (t = 0, e = -e) : (t = (e >> 4) + 5, e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? R : (s.window !== null && s.wbits !== e && (s.window = null), s.wrap = t, s.wbits = e, pe(i));
1223
+ return S;
1224
+ const n = i.state;
1225
+ return e < 0 ? (t = 0, e = -e) : (t = (e >> 4) + 5, e < 48 && (e &= 15)), e && (e < 8 || e > 15) ? S : (n.window !== null && n.wbits !== e && (n.window = null), n.wrap = t, n.wbits = e, pe(i));
1223
1226
  }, ge = (i, e) => {
1224
1227
  if (!i)
1225
- return R;
1228
+ return S;
1226
1229
  const t = new xi();
1227
1230
  i.state = t, t.strm = i, t.window = null, t.mode = tt;
1228
- const s = we(i, e);
1229
- return s !== L && (i.state = null), s;
1231
+ const n = we(i, e);
1232
+ return n !== L && (i.state = null), n;
1230
1233
  }, yi = (i) => ge(i, bi);
1231
- let Kt = !0, rt, ot;
1232
- const Ei = (i) => {
1233
- if (Kt) {
1234
+ let Yt = !0, rt, ot;
1235
+ const ki = (i) => {
1236
+ if (Yt) {
1234
1237
  rt = new Int32Array(512), ot = new Int32Array(32);
1235
1238
  let e = 0;
1236
1239
  for (; e < 144; )
@@ -1243,39 +1246,39 @@ const Ei = (i) => {
1243
1246
  i.lens[e++] = 8;
1244
1247
  for (H(he, i.lens, 0, 288, rt, 0, i.work, { bits: 9 }), e = 0; e < 32; )
1245
1248
  i.lens[e++] = 5;
1246
- H(le, i.lens, 0, 32, ot, 0, i.work, { bits: 5 }), Kt = !1;
1249
+ H(le, i.lens, 0, 32, ot, 0, i.work, { bits: 5 }), Yt = !1;
1247
1250
  }
1248
1251
  i.lencode = rt, i.lenbits = 9, i.distcode = ot, i.distbits = 5;
1249
- }, be = (i, e, t, s) => {
1252
+ }, be = (i, e, t, n) => {
1250
1253
  let a;
1251
- const n = i.state;
1252
- return n.window === null && (n.wsize = 1 << n.wbits, n.wnext = 0, n.whave = 0, n.window = new Uint8Array(n.wsize)), s >= n.wsize ? (n.window.set(e.subarray(t - n.wsize, t), 0), n.wnext = 0, n.whave = n.wsize) : (a = n.wsize - n.wnext, a > s && (a = s), n.window.set(e.subarray(t - s, t - s + a), n.wnext), s -= a, s ? (n.window.set(e.subarray(t - s, t), 0), n.wnext = s, n.whave = n.wsize) : (n.wnext += a, n.wnext === n.wsize && (n.wnext = 0), n.whave < n.wsize && (n.whave += a))), 0;
1253
- }, ki = (i, e) => {
1254
- let t, s, a, n, l, h, d, r, o, w, u, f, _, U, x = 0, g, T, y, c, k, I, p, m;
1254
+ const s = i.state;
1255
+ return s.window === null && (s.wsize = 1 << s.wbits, s.wnext = 0, s.whave = 0, s.window = new Uint8Array(s.wsize)), n >= s.wsize ? (s.window.set(e.subarray(t - s.wsize, t), 0), s.wnext = 0, s.whave = s.wsize) : (a = s.wsize - s.wnext, a > n && (a = n), s.window.set(e.subarray(t - n, t - n + a), s.wnext), n -= a, n ? (s.window.set(e.subarray(t - n, t), 0), s.wnext = n, s.whave = s.wsize) : (s.wnext += a, s.wnext === s.wsize && (s.wnext = 0), s.whave < s.wsize && (s.whave += a))), 0;
1256
+ }, Ei = (i, e) => {
1257
+ let t, n, a, s, l, h, d, r, o, w, u, f, _, U, x = 0, g, T, y, c, E, I, p, m;
1255
1258
  const A = new Uint8Array(4);
1256
- let b, E;
1259
+ let b, k;
1257
1260
  const M = (
1258
1261
  /* permutation of code lengths */
1259
1262
  new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
1260
1263
  );
1261
1264
  if (B(i) || !i.output || !i.input && i.avail_in !== 0)
1262
- return R;
1263
- t = i.state, t.mode === N && (t.mode = st), l = i.next_out, a = i.output, d = i.avail_out, n = i.next_in, s = i.input, h = i.avail_in, r = t.hold, o = t.bits, w = h, u = d, m = L;
1265
+ return S;
1266
+ t = i.state, t.mode === C && (t.mode = nt), l = i.next_out, a = i.output, d = i.avail_out, s = i.next_in, n = i.input, h = i.avail_in, r = t.hold, o = t.bits, w = h, u = d, m = L;
1264
1267
  t:
1265
1268
  for (; ; )
1266
1269
  switch (t.mode) {
1267
1270
  case tt:
1268
1271
  if (t.wrap === 0) {
1269
- t.mode = st;
1272
+ t.mode = nt;
1270
1273
  break;
1271
1274
  }
1272
1275
  for (; o < 16; ) {
1273
1276
  if (h === 0)
1274
1277
  break t;
1275
- h--, r += s[n++] << o, o += 8;
1278
+ h--, r += n[s++] << o, o += 8;
1276
1279
  }
1277
1280
  if (t.wrap & 2 && r === 35615) {
1278
- t.wbits === 0 && (t.wbits = 15), t.check = 0, A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = S(t.check, A, 2, 0), r = 0, o = 0, t.mode = mt;
1281
+ t.wbits === 0 && (t.wbits = 15), t.check = 0, A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = R(t.check, A, 2, 0), r = 0, o = 0, t.mode = mt;
1279
1282
  break;
1280
1283
  }
1281
1284
  if (t.head && (t.head.done = !1), !(t.wrap & 1) || /* check if zlib header allowed */
@@ -1291,13 +1294,13 @@ const Ei = (i) => {
1291
1294
  i.msg = "invalid window size", t.mode = v;
1292
1295
  break;
1293
1296
  }
1294
- t.dmax = 1 << t.wbits, t.flags = 0, i.adler = t.check = 1, t.mode = r & 512 ? Ct : N, r = 0, o = 0;
1297
+ t.dmax = 1 << t.wbits, t.flags = 0, i.adler = t.check = 1, t.mode = r & 512 ? Nt : C, r = 0, o = 0;
1295
1298
  break;
1296
1299
  case mt:
1297
1300
  for (; o < 16; ) {
1298
1301
  if (h === 0)
1299
1302
  break t;
1300
- h--, r += s[n++] << o, o += 8;
1303
+ h--, r += n[s++] << o, o += 8;
1301
1304
  }
1302
1305
  if (t.flags = r, (t.flags & 255) !== Tt) {
1303
1306
  i.msg = "unknown compression method", t.mode = v;
@@ -1307,81 +1310,81 @@ const Ei = (i) => {
1307
1310
  i.msg = "unknown header flags set", t.mode = v;
1308
1311
  break;
1309
1312
  }
1310
- t.head && (t.head.text = r >> 8 & 1), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = S(t.check, A, 2, 0)), r = 0, o = 0, t.mode = vt;
1313
+ t.head && (t.head.text = r >> 8 & 1), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = R(t.check, A, 2, 0)), r = 0, o = 0, t.mode = vt;
1311
1314
  /* falls through */
1312
1315
  case vt:
1313
1316
  for (; o < 32; ) {
1314
1317
  if (h === 0)
1315
1318
  break t;
1316
- h--, r += s[n++] << o, o += 8;
1319
+ h--, r += n[s++] << o, o += 8;
1317
1320
  }
1318
- t.head && (t.head.time = r), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, A[2] = r >>> 16 & 255, A[3] = r >>> 24 & 255, t.check = S(t.check, A, 4, 0)), r = 0, o = 0, t.mode = Ut;
1321
+ t.head && (t.head.time = r), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, A[2] = r >>> 16 & 255, A[3] = r >>> 24 & 255, t.check = R(t.check, A, 4, 0)), r = 0, o = 0, t.mode = Ut;
1319
1322
  /* falls through */
1320
1323
  case Ut:
1321
1324
  for (; o < 16; ) {
1322
1325
  if (h === 0)
1323
1326
  break t;
1324
- h--, r += s[n++] << o, o += 8;
1327
+ h--, r += n[s++] << o, o += 8;
1325
1328
  }
1326
- t.head && (t.head.xflags = r & 255, t.head.os = r >> 8), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = S(t.check, A, 2, 0)), r = 0, o = 0, t.mode = It;
1329
+ t.head && (t.head.xflags = r & 255, t.head.os = r >> 8), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = R(t.check, A, 2, 0)), r = 0, o = 0, t.mode = It;
1327
1330
  /* falls through */
1328
1331
  case It:
1329
1332
  if (t.flags & 1024) {
1330
1333
  for (; o < 16; ) {
1331
1334
  if (h === 0)
1332
1335
  break t;
1333
- h--, r += s[n++] << o, o += 8;
1336
+ h--, r += n[s++] << o, o += 8;
1334
1337
  }
1335
- t.length = r, t.head && (t.head.extra_len = r), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = S(t.check, A, 2, 0)), r = 0, o = 0;
1338
+ t.length = r, t.head && (t.head.extra_len = r), t.flags & 512 && t.wrap & 4 && (A[0] = r & 255, A[1] = r >>> 8 & 255, t.check = R(t.check, A, 2, 0)), r = 0, o = 0;
1336
1339
  } else t.head && (t.head.extra = null);
1337
1340
  t.mode = Ot;
1338
1341
  /* falls through */
1339
1342
  case Ot:
1340
1343
  if (t.flags & 1024 && (f = t.length, f > h && (f = h), f && (t.head && (p = t.head.extra_len - t.length, t.head.extra || (t.head.extra = new Uint8Array(t.head.extra_len)), t.head.extra.set(
1341
- s.subarray(
1342
- n,
1344
+ n.subarray(
1345
+ s,
1343
1346
  // extra field is limited to 65536 bytes
1344
1347
  // - no need for additional size check
1345
- n + f
1348
+ s + f
1346
1349
  ),
1347
1350
  /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
1348
1351
  p
1349
- )), t.flags & 512 && t.wrap & 4 && (t.check = S(t.check, s, f, n)), h -= f, n += f, t.length -= f), t.length))
1352
+ )), t.flags & 512 && t.wrap & 4 && (t.check = R(t.check, n, f, s)), h -= f, s += f, t.length -= f), t.length))
1350
1353
  break t;
1351
- t.length = 0, t.mode = Rt;
1354
+ t.length = 0, t.mode = St;
1352
1355
  /* falls through */
1353
- case Rt:
1356
+ case St:
1354
1357
  if (t.flags & 2048) {
1355
1358
  if (h === 0)
1356
1359
  break t;
1357
1360
  f = 0;
1358
1361
  do
1359
- p = s[n + f++], t.head && p && t.length < 65536 && (t.head.name += String.fromCharCode(p));
1362
+ p = n[s + f++], t.head && p && t.length < 65536 && (t.head.name += String.fromCharCode(p));
1360
1363
  while (p && f < h);
1361
- if (t.flags & 512 && t.wrap & 4 && (t.check = S(t.check, s, f, n)), h -= f, n += f, p)
1364
+ if (t.flags & 512 && t.wrap & 4 && (t.check = R(t.check, n, f, s)), h -= f, s += f, p)
1362
1365
  break t;
1363
1366
  } else t.head && (t.head.name = null);
1364
- t.length = 0, t.mode = St;
1367
+ t.length = 0, t.mode = Rt;
1365
1368
  /* falls through */
1366
- case St:
1369
+ case Rt:
1367
1370
  if (t.flags & 4096) {
1368
1371
  if (h === 0)
1369
1372
  break t;
1370
1373
  f = 0;
1371
1374
  do
1372
- p = s[n + f++], t.head && p && t.length < 65536 && (t.head.comment += String.fromCharCode(p));
1375
+ p = n[s + f++], t.head && p && t.length < 65536 && (t.head.comment += String.fromCharCode(p));
1373
1376
  while (p && f < h);
1374
- if (t.flags & 512 && t.wrap & 4 && (t.check = S(t.check, s, f, n)), h -= f, n += f, p)
1377
+ if (t.flags & 512 && t.wrap & 4 && (t.check = R(t.check, n, f, s)), h -= f, s += f, p)
1375
1378
  break t;
1376
1379
  } else t.head && (t.head.comment = null);
1377
- t.mode = Nt;
1380
+ t.mode = Ct;
1378
1381
  /* falls through */
1379
- case Nt:
1382
+ case Ct:
1380
1383
  if (t.flags & 512) {
1381
1384
  for (; o < 16; ) {
1382
1385
  if (h === 0)
1383
1386
  break t;
1384
- h--, r += s[n++] << o, o += 8;
1387
+ h--, r += n[s++] << o, o += 8;
1385
1388
  }
1386
1389
  if (t.wrap & 4 && r !== (t.check & 65535)) {
1387
1390
  i.msg = "header crc mismatch", t.mode = v;
@@ -1389,26 +1392,26 @@ const Ei = (i) => {
1389
1392
  }
1390
1393
  r = 0, o = 0;
1391
1394
  }
1392
- t.head && (t.head.hcrc = t.flags >> 9 & 1, t.head.done = !0), i.adler = t.check = 0, t.mode = N;
1395
+ t.head && (t.head.hcrc = t.flags >> 9 & 1, t.head.done = !0), i.adler = t.check = 0, t.mode = C;
1393
1396
  break;
1394
- case Ct:
1397
+ case Nt:
1395
1398
  for (; o < 32; ) {
1396
1399
  if (h === 0)
1397
1400
  break t;
1398
- h--, r += s[n++] << o, o += 8;
1401
+ h--, r += n[s++] << o, o += 8;
1399
1402
  }
1400
- i.adler = t.check = Yt(r), r = 0, o = 0, t.mode = Q;
1403
+ i.adler = t.check = Kt(r), r = 0, o = 0, t.mode = Q;
1401
1404
  /* falls through */
1402
1405
  case Q:
1403
1406
  if (t.havedict === 0)
1404
- return i.next_out = l, i.avail_out = d, i.next_in = n, i.avail_in = h, t.hold = r, t.bits = o, ui;
1405
- i.adler = t.check = 1, t.mode = N;
1407
+ return i.next_out = l, i.avail_out = d, i.next_in = s, i.avail_in = h, t.hold = r, t.bits = o, ui;
1408
+ i.adler = t.check = 1, t.mode = C;
1406
1409
  /* falls through */
1407
- case N:
1408
- if (e === ci || e === K)
1410
+ case C:
1411
+ if (e === ci || e === Y)
1409
1412
  break t;
1410
1413
  /* falls through */
1411
- case st:
1414
+ case nt:
1412
1415
  if (t.last) {
1413
1416
  r >>>= o & 7, o -= o & 7, t.mode = at;
1414
1417
  break;
@@ -1416,14 +1419,14 @@ const Ei = (i) => {
1416
1419
  for (; o < 3; ) {
1417
1420
  if (h === 0)
1418
1421
  break t;
1419
- h--, r += s[n++] << o, o += 8;
1422
+ h--, r += n[s++] << o, o += 8;
1420
1423
  }
1421
1424
  switch (t.last = r & 1, r >>>= 1, o -= 1, r & 3) {
1422
1425
  case 0:
1423
1426
  t.mode = Dt;
1424
1427
  break;
1425
1428
  case 1:
1426
- if (Ei(t), t.mode = j, e === K) {
1429
+ if (ki(t), t.mode = j, e === Y) {
1427
1430
  r >>>= 2, o -= 2;
1428
1431
  break t;
1429
1432
  }
@@ -1440,32 +1443,32 @@ const Ei = (i) => {
1440
1443
  for (r >>>= o & 7, o -= o & 7; o < 32; ) {
1441
1444
  if (h === 0)
1442
1445
  break t;
1443
- h--, r += s[n++] << o, o += 8;
1446
+ h--, r += n[s++] << o, o += 8;
1444
1447
  }
1445
1448
  if ((r & 65535) !== (r >>> 16 ^ 65535)) {
1446
1449
  i.msg = "invalid stored block lengths", t.mode = v;
1447
1450
  break;
1448
1451
  }
1449
- if (t.length = r & 65535, r = 0, o = 0, t.mode = nt, e === K)
1452
+ if (t.length = r & 65535, r = 0, o = 0, t.mode = st, e === Y)
1450
1453
  break t;
1451
1454
  /* falls through */
1452
- case nt:
1455
+ case st:
1453
1456
  t.mode = Mt;
1454
1457
  /* falls through */
1455
1458
  case Mt:
1456
1459
  if (f = t.length, f) {
1457
1460
  if (f > h && (f = h), f > d && (f = d), f === 0)
1458
1461
  break t;
1459
- a.set(s.subarray(n, n + f), l), h -= f, n += f, d -= f, l += f, t.length -= f;
1462
+ a.set(n.subarray(s, s + f), l), h -= f, s += f, d -= f, l += f, t.length -= f;
1460
1463
  break;
1461
1464
  }
1462
- t.mode = N;
1465
+ t.mode = C;
1463
1466
  break;
1464
1467
  case Lt:
1465
1468
  for (; o < 14; ) {
1466
1469
  if (h === 0)
1467
1470
  break t;
1468
- h--, r += s[n++] << o, o += 8;
1471
+ h--, r += n[s++] << o, o += 8;
1469
1472
  }
1470
1473
  if (t.nlen = (r & 31) + 257, r >>>= 5, o -= 5, t.ndist = (r & 31) + 1, r >>>= 5, o -= 5, t.ncode = (r & 15) + 4, r >>>= 4, o -= 4, t.nlen > 286 || t.ndist > 30) {
1471
1474
  i.msg = "too many length or distance symbols", t.mode = v;
@@ -1478,7 +1481,7 @@ const Ei = (i) => {
1478
1481
  for (; o < 3; ) {
1479
1482
  if (h === 0)
1480
1483
  break t;
1481
- h--, r += s[n++] << o, o += 8;
1484
+ h--, r += n[s++] << o, o += 8;
1482
1485
  }
1483
1486
  t.lens[M[t.have++]] = r & 7, r >>>= 3, o -= 3;
1484
1487
  }
@@ -1495,16 +1498,16 @@ const Ei = (i) => {
1495
1498
  for (; x = t.lencode[r & (1 << t.lenbits) - 1], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(g <= o); ) {
1496
1499
  if (h === 0)
1497
1500
  break t;
1498
- h--, r += s[n++] << o, o += 8;
1501
+ h--, r += n[s++] << o, o += 8;
1499
1502
  }
1500
1503
  if (y < 16)
1501
1504
  r >>>= g, o -= g, t.lens[t.have++] = y;
1502
1505
  else {
1503
1506
  if (y === 16) {
1504
- for (E = g + 2; o < E; ) {
1507
+ for (k = g + 2; o < k; ) {
1505
1508
  if (h === 0)
1506
1509
  break t;
1507
- h--, r += s[n++] << o, o += 8;
1510
+ h--, r += n[s++] << o, o += 8;
1508
1511
  }
1509
1512
  if (r >>>= g, o -= g, t.have === 0) {
1510
1513
  i.msg = "invalid bit length repeat", t.mode = v;
@@ -1512,17 +1515,17 @@ const Ei = (i) => {
1512
1515
  }
1513
1516
  p = t.lens[t.have - 1], f = 3 + (r & 3), r >>>= 2, o -= 2;
1514
1517
  } else if (y === 17) {
1515
- for (E = g + 3; o < E; ) {
1518
+ for (k = g + 3; o < k; ) {
1516
1519
  if (h === 0)
1517
1520
  break t;
1518
- h--, r += s[n++] << o, o += 8;
1521
+ h--, r += n[s++] << o, o += 8;
1519
1522
  }
1520
1523
  r >>>= g, o -= g, p = 0, f = 3 + (r & 7), r >>>= 3, o -= 3;
1521
1524
  } else {
1522
- for (E = g + 7; o < E; ) {
1525
+ for (k = g + 7; o < k; ) {
1523
1526
  if (h === 0)
1524
1527
  break t;
1525
- h--, r += s[n++] << o, o += 8;
1528
+ h--, r += n[s++] << o, o += 8;
1526
1529
  }
1527
1530
  r >>>= g, o -= g, p = 0, f = 11 + (r & 127), r >>>= 7, o -= 7;
1528
1531
  }
@@ -1548,7 +1551,7 @@ const Ei = (i) => {
1548
1551
  i.msg = "invalid distances set", t.mode = v;
1549
1552
  break;
1550
1553
  }
1551
- if (t.mode = j, e === K)
1554
+ if (t.mode = j, e === Y)
1552
1555
  break t;
1553
1556
  /* falls through */
1554
1557
  case j:
@@ -1556,19 +1559,19 @@ const Ei = (i) => {
1556
1559
  /* falls through */
1557
1560
  case X:
1558
1561
  if (h >= 6 && d >= 258) {
1559
- i.next_out = l, i.avail_out = d, i.next_in = n, i.avail_in = h, t.hold = r, t.bits = o, ni(i, u), l = i.next_out, a = i.output, d = i.avail_out, n = i.next_in, s = i.input, h = i.avail_in, r = t.hold, o = t.bits, t.mode === N && (t.back = -1);
1562
+ i.next_out = l, i.avail_out = d, i.next_in = s, i.avail_in = h, t.hold = r, t.bits = o, si(i, u), l = i.next_out, a = i.output, d = i.avail_out, s = i.next_in, n = i.input, h = i.avail_in, r = t.hold, o = t.bits, t.mode === C && (t.back = -1);
1560
1563
  break;
1561
1564
  }
1562
1565
  for (t.back = 0; x = t.lencode[r & (1 << t.lenbits) - 1], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(g <= o); ) {
1563
1566
  if (h === 0)
1564
1567
  break t;
1565
- h--, r += s[n++] << o, o += 8;
1568
+ h--, r += n[s++] << o, o += 8;
1566
1569
  }
1567
1570
  if (T && (T & 240) === 0) {
1568
- for (c = g, k = T, I = y; x = t.lencode[I + ((r & (1 << c + k) - 1) >> c)], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(c + g <= o); ) {
1571
+ for (c = g, E = T, I = y; x = t.lencode[I + ((r & (1 << c + E) - 1) >> c)], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(c + g <= o); ) {
1569
1572
  if (h === 0)
1570
1573
  break t;
1571
- h--, r += s[n++] << o, o += 8;
1574
+ h--, r += n[s++] << o, o += 8;
1572
1575
  }
1573
1576
  r >>>= c, o -= c, t.back += c;
1574
1577
  }
@@ -1577,7 +1580,7 @@ const Ei = (i) => {
1577
1580
  break;
1578
1581
  }
1579
1582
  if (T & 32) {
1580
- t.back = -1, t.mode = N;
1583
+ t.back = -1, t.mode = C;
1581
1584
  break;
1582
1585
  }
1583
1586
  if (T & 64) {
@@ -1588,10 +1591,10 @@ const Ei = (i) => {
1588
1591
  /* falls through */
1589
1592
  case Ft:
1590
1593
  if (t.extra) {
1591
- for (E = t.extra; o < E; ) {
1594
+ for (k = t.extra; o < k; ) {
1592
1595
  if (h === 0)
1593
1596
  break t;
1594
- h--, r += s[n++] << o, o += 8;
1597
+ h--, r += n[s++] << o, o += 8;
1595
1598
  }
1596
1599
  t.length += r & (1 << t.extra) - 1, r >>>= t.extra, o -= t.extra, t.back += t.extra;
1597
1600
  }
@@ -1601,13 +1604,13 @@ const Ei = (i) => {
1601
1604
  for (; x = t.distcode[r & (1 << t.distbits) - 1], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(g <= o); ) {
1602
1605
  if (h === 0)
1603
1606
  break t;
1604
- h--, r += s[n++] << o, o += 8;
1607
+ h--, r += n[s++] << o, o += 8;
1605
1608
  }
1606
1609
  if ((T & 240) === 0) {
1607
- for (c = g, k = T, I = y; x = t.distcode[I + ((r & (1 << c + k) - 1) >> c)], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(c + g <= o); ) {
1610
+ for (c = g, E = T, I = y; x = t.distcode[I + ((r & (1 << c + E) - 1) >> c)], g = x >>> 24, T = x >>> 16 & 255, y = x & 65535, !(c + g <= o); ) {
1608
1611
  if (h === 0)
1609
1612
  break t;
1610
- h--, r += s[n++] << o, o += 8;
1613
+ h--, r += n[s++] << o, o += 8;
1611
1614
  }
1612
1615
  r >>>= c, o -= c, t.back += c;
1613
1616
  }
@@ -1619,10 +1622,10 @@ const Ei = (i) => {
1619
1622
  /* falls through */
1620
1623
  case Zt:
1621
1624
  if (t.extra) {
1622
- for (E = t.extra; o < E; ) {
1625
+ for (k = t.extra; o < k; ) {
1623
1626
  if (h === 0)
1624
1627
  break t;
1625
- h--, r += s[n++] << o, o += 8;
1628
+ h--, r += n[s++] << o, o += 8;
1626
1629
  }
1627
1630
  t.offset += r & (1 << t.extra) - 1, r >>>= t.extra, o -= t.extra, t.back += t.extra;
1628
1631
  }
@@ -1659,10 +1662,10 @@ const Ei = (i) => {
1659
1662
  for (; o < 32; ) {
1660
1663
  if (h === 0)
1661
1664
  break t;
1662
- h--, r |= s[n++] << o, o += 8;
1665
+ h--, r |= n[s++] << o, o += 8;
1663
1666
  }
1664
1667
  if (u -= d, i.total_out += u, t.total += u, t.wrap & 4 && u && (i.adler = t.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
1665
- t.flags ? S(t.check, a, u, l - u) : ut(t.check, a, u, l - u)), u = d, t.wrap & 4 && (t.flags ? r : Yt(r)) !== t.check) {
1668
+ t.flags ? R(t.check, a, u, l - u) : ut(t.check, a, u, l - u)), u = d, t.wrap & 4 && (t.flags ? r : Kt(r)) !== t.check) {
1666
1669
  i.msg = "incorrect data check", t.mode = v;
1667
1670
  break;
1668
1671
  }
@@ -1675,7 +1678,7 @@ const Ei = (i) => {
1675
1678
  for (; o < 32; ) {
1676
1679
  if (h === 0)
1677
1680
  break t;
1678
- h--, r += s[n++] << o, o += 8;
1681
+ h--, r += n[s++] << o, o += 8;
1679
1682
  }
1680
1683
  if (t.wrap & 4 && r !== (t.total & 4294967295)) {
1681
1684
  i.msg = "incorrect length check", t.mode = v;
@@ -1696,34 +1699,34 @@ const Ei = (i) => {
1696
1699
  case ue:
1697
1700
  /* falls through */
1698
1701
  default:
1699
- return R;
1702
+ return S;
1700
1703
  }
1701
- return i.next_out = l, i.avail_out = d, i.next_in = n, i.avail_in = h, t.hold = r, t.bits = o, (t.wsize || u !== i.avail_out && t.mode < v && (t.mode < at || e !== At)) && be(i, i.output, i.next_out, u - i.avail_out), w -= i.avail_in, u -= i.avail_out, i.total_in += w, i.total_out += u, t.total += u, t.wrap & 4 && u && (i.adler = t.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
1702
- t.flags ? S(t.check, a, u, i.next_out - u) : ut(t.check, a, u, i.next_out - u)), i.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === N ? 128 : 0) + (t.mode === j || t.mode === nt ? 256 : 0), (w === 0 && u === 0 || e === At) && m === L && (m = _i), m;
1704
+ return i.next_out = l, i.avail_out = d, i.next_in = s, i.avail_in = h, t.hold = r, t.bits = o, (t.wsize || u !== i.avail_out && t.mode < v && (t.mode < at || e !== At)) && be(i, i.output, i.next_out, u - i.avail_out), w -= i.avail_in, u -= i.avail_out, i.total_in += w, i.total_out += u, t.total += u, t.wrap & 4 && u && (i.adler = t.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
1705
+ t.flags ? R(t.check, a, u, i.next_out - u) : ut(t.check, a, u, i.next_out - u)), i.data_type = t.bits + (t.last ? 64 : 0) + (t.mode === C ? 128 : 0) + (t.mode === j || t.mode === st ? 256 : 0), (w === 0 && u === 0 || e === At) && m === L && (m = _i), m;
1703
1706
  }, Ai = (i) => {
1704
1707
  if (B(i))
1705
- return R;
1708
+ return S;
1706
1709
  let e = i.state;
1707
1710
  return e.window && (e.window = null), i.state = null, L;
1708
1711
  }, Ti = (i, e) => {
1709
1712
  if (B(i))
1710
- return R;
1713
+ return S;
1711
1714
  const t = i.state;
1712
- return (t.wrap & 2) === 0 ? R : (t.head = e, e.done = !1, L);
1715
+ return (t.wrap & 2) === 0 ? S : (t.head = e, e.done = !1, L);
1713
1716
  }, mi = (i, e) => {
1714
1717
  const t = e.length;
1715
- let s, a, n;
1716
- return B(i) || (s = i.state, s.wrap !== 0 && s.mode !== Q) ? R : s.mode === Q && (a = 1, a = ut(a, e, t, 0), a !== s.check) ? fe : (n = be(i, e, t, t), n ? (s.mode = de, ce) : (s.havedict = 1, L));
1718
+ let n, a, s;
1719
+ return B(i) || (n = i.state, n.wrap !== 0 && n.mode !== Q) ? S : n.mode === Q && (a = 1, a = ut(a, e, t, 0), a !== n.check) ? fe : (s = be(i, e, t, t), s ? (n.mode = de, ce) : (n.havedict = 1, L));
1717
1720
  };
1718
- var vi = pe, Ui = we, Ii = _e, Oi = yi, Ri = ge, Si = ki, Ni = Ai, Ci = Ti, Di = mi, Mi = "pako inflate (from Nodeca project)", D = {
1721
+ var vi = pe, Ui = we, Ii = _e, Oi = yi, Si = ge, Ri = Ei, Ci = Ai, Ni = Ti, Di = mi, Mi = "pako inflate (from Nodeca project)", D = {
1719
1722
  inflateReset: vi,
1720
1723
  inflateReset2: Ui,
1721
1724
  inflateResetKeep: Ii,
1722
1725
  inflateInit: Oi,
1723
- inflateInit2: Ri,
1724
- inflate: Si,
1725
- inflateEnd: Ni,
1726
- inflateGetHeader: Ci,
1726
+ inflateInit2: Si,
1727
+ inflate: Ri,
1728
+ inflateEnd: Ci,
1729
+ inflateGetHeader: Ni,
1727
1730
  inflateSetDictionary: Di,
1728
1731
  inflateInfo: Mi
1729
1732
  };
@@ -1759,28 +1762,28 @@ function z(i) {
1759
1762
  throw new Error(_t[t]);
1760
1763
  }
1761
1764
  z.prototype.push = function(i, e) {
1762
- const t = this.strm, s = this.options.chunkSize, a = this.options.dictionary;
1763
- let n, l, h;
1765
+ const t = this.strm, n = this.options.chunkSize, a = this.options.dictionary;
1766
+ let s, l, h;
1764
1767
  if (this.ended) return !1;
1765
1768
  for (e === ~~e ? l = e : l = e === !0 ? Fi : $i, xe.call(i) === "[object ArrayBuffer]" ? t.input = new Uint8Array(i) : t.input = i, t.next_in = 0, t.avail_in = t.input.length; ; ) {
1766
- for (t.avail_out === 0 && (t.output = new Uint8Array(s), t.next_out = 0, t.avail_out = s), n = D.inflate(t, l), n === lt && a && (n = D.inflateSetDictionary(t, a), n === W ? n = D.inflate(t, l) : n === jt && (n = lt)); t.avail_in > 0 && n === ht && t.state.wrap > 0 && i[t.next_in] !== 0; )
1767
- D.inflateReset(t), n = D.inflate(t, l);
1768
- switch (n) {
1769
+ for (t.avail_out === 0 && (t.output = new Uint8Array(n), t.next_out = 0, t.avail_out = n), s = D.inflate(t, l), s === lt && a && (s = D.inflateSetDictionary(t, a), s === W ? s = D.inflate(t, l) : s === jt && (s = lt)); t.avail_in > 0 && s === ht && t.state.wrap > 0 && i[t.next_in] !== 0; )
1770
+ D.inflateReset(t), s = D.inflate(t, l);
1771
+ switch (s) {
1769
1772
  case Hi:
1770
1773
  case jt:
1771
1774
  case lt:
1772
1775
  case Zi:
1773
- return this.onEnd(n), this.ended = !0, !1;
1776
+ return this.onEnd(s), this.ended = !0, !1;
1774
1777
  }
1775
- if (h = t.avail_out, t.next_out && (t.avail_out === 0 || n === ht))
1778
+ if (h = t.avail_out, t.next_out && (t.avail_out === 0 || s === ht))
1776
1779
  if (this.options.to === "string") {
1777
1780
  let d = pt.utf8border(t.output, t.next_out), r = t.next_out - d, o = pt.buf2string(t.output, d);
1778
- t.next_out = r, t.avail_out = s - r, r && t.output.set(t.output.subarray(d, d + r), 0), this.onData(o);
1781
+ t.next_out = r, t.avail_out = n - r, r && t.output.set(t.output.subarray(d, d + r), 0), this.onData(o);
1779
1782
  } else
1780
1783
  this.onData(t.output.length === t.next_out ? t.output : t.output.subarray(0, t.next_out));
1781
- if (!(n === W && h === 0)) {
1782
- if (n === ht)
1783
- return n = D.inflateEnd(this.strm), this.onEnd(n), this.ended = !0, !0;
1784
+ if (!(s === W && h === 0)) {
1785
+ if (s === ht)
1786
+ return s = D.inflateEnd(this.strm), this.onEnd(s), this.ended = !0, !0;
1784
1787
  if (t.avail_in === 0) break;
1785
1788
  }
1786
1789
  }
@@ -1801,8 +1804,8 @@ var zi = z, Pi = Wi, Gi = {
1801
1804
  Inflate: zi,
1802
1805
  inflate: Pi
1803
1806
  };
1804
- const { Inflate: Yi, inflate: Ki } = Gi;
1805
- var Xt = Yi, ji = Ki;
1807
+ const { Inflate: Ki, inflate: Yi } = Gi;
1808
+ var Xt = Ki, ji = Yi;
1806
1809
  const ye = [];
1807
1810
  for (let i = 0; i < 256; i++) {
1808
1811
  let e = i;
@@ -1812,95 +1815,95 @@ for (let i = 0; i < 256; i++) {
1812
1815
  }
1813
1816
  const Vt = 4294967295;
1814
1817
  function Xi(i, e, t) {
1815
- let s = i;
1818
+ let n = i;
1816
1819
  for (let a = 0; a < t; a++)
1817
- s = ye[(s ^ e[a]) & 255] ^ s >>> 8;
1818
- return s;
1820
+ n = ye[(n ^ e[a]) & 255] ^ n >>> 8;
1821
+ return n;
1819
1822
  }
1820
1823
  function Vi(i, e) {
1821
1824
  return (Xi(Vt, i, e) ^ Vt) >>> 0;
1822
1825
  }
1823
1826
  function qt(i, e, t) {
1824
- const s = i.readUint32(), a = Vi(new Uint8Array(i.buffer, i.byteOffset + i.offset - e - 4, e), e);
1825
- if (a !== s)
1826
- throw new Error(`CRC mismatch for chunk ${t}. Expected ${s}, found ${a}`);
1827
+ const n = i.readUint32(), a = Vi(new Uint8Array(i.buffer, i.byteOffset + i.offset - e - 4, e), e);
1828
+ if (a !== n)
1829
+ throw new Error(`CRC mismatch for chunk ${t}. Expected ${n}, found ${a}`);
1827
1830
  }
1828
- function Ee(i, e, t) {
1829
- for (let s = 0; s < t; s++)
1830
- e[s] = i[s];
1831
+ function ke(i, e, t) {
1832
+ for (let n = 0; n < t; n++)
1833
+ e[n] = i[n];
1831
1834
  }
1832
- function ke(i, e, t, s) {
1835
+ function Ee(i, e, t, n) {
1833
1836
  let a = 0;
1834
- for (; a < s; a++)
1837
+ for (; a < n; a++)
1835
1838
  e[a] = i[a];
1836
1839
  for (; a < t; a++)
1837
- e[a] = i[a] + e[a - s] & 255;
1840
+ e[a] = i[a] + e[a - n] & 255;
1838
1841
  }
1839
- function Ae(i, e, t, s) {
1842
+ function Ae(i, e, t, n) {
1840
1843
  let a = 0;
1841
1844
  if (t.length === 0)
1842
- for (; a < s; a++)
1845
+ for (; a < n; a++)
1843
1846
  e[a] = i[a];
1844
1847
  else
1845
- for (; a < s; a++)
1848
+ for (; a < n; a++)
1846
1849
  e[a] = i[a] + t[a] & 255;
1847
1850
  }
1848
- function Te(i, e, t, s, a) {
1849
- let n = 0;
1851
+ function Te(i, e, t, n, a) {
1852
+ let s = 0;
1850
1853
  if (t.length === 0) {
1851
- for (; n < a; n++)
1852
- e[n] = i[n];
1853
- for (; n < s; n++)
1854
- e[n] = i[n] + (e[n - a] >> 1) & 255;
1854
+ for (; s < a; s++)
1855
+ e[s] = i[s];
1856
+ for (; s < n; s++)
1857
+ e[s] = i[s] + (e[s - a] >> 1) & 255;
1855
1858
  } else {
1856
- for (; n < a; n++)
1857
- e[n] = i[n] + (t[n] >> 1) & 255;
1858
- for (; n < s; n++)
1859
- e[n] = i[n] + (e[n - a] + t[n] >> 1) & 255;
1859
+ for (; s < a; s++)
1860
+ e[s] = i[s] + (t[s] >> 1) & 255;
1861
+ for (; s < n; s++)
1862
+ e[s] = i[s] + (e[s - a] + t[s] >> 1) & 255;
1860
1863
  }
1861
1864
  }
1862
- function me(i, e, t, s, a) {
1863
- let n = 0;
1865
+ function me(i, e, t, n, a) {
1866
+ let s = 0;
1864
1867
  if (t.length === 0) {
1865
- for (; n < a; n++)
1866
- e[n] = i[n];
1867
- for (; n < s; n++)
1868
- e[n] = i[n] + e[n - a] & 255;
1868
+ for (; s < a; s++)
1869
+ e[s] = i[s];
1870
+ for (; s < n; s++)
1871
+ e[s] = i[s] + e[s - a] & 255;
1869
1872
  } else {
1870
- for (; n < a; n++)
1871
- e[n] = i[n] + t[n] & 255;
1872
- for (; n < s; n++)
1873
- e[n] = i[n] + qi(e[n - a], t[n], t[n - a]) & 255;
1873
+ for (; s < a; s++)
1874
+ e[s] = i[s] + t[s] & 255;
1875
+ for (; s < n; s++)
1876
+ e[s] = i[s] + qi(e[s - a], t[s], t[s - a]) & 255;
1874
1877
  }
1875
1878
  }
1876
1879
  function qi(i, e, t) {
1877
- const s = i + e - t, a = Math.abs(s - i), n = Math.abs(s - e), l = Math.abs(s - t);
1878
- return a <= n && a <= l ? i : n <= l ? e : t;
1880
+ const n = i + e - t, a = Math.abs(n - i), s = Math.abs(n - e), l = Math.abs(n - t);
1881
+ return a <= s && a <= l ? i : s <= l ? e : t;
1879
1882
  }
1880
- function Ji(i, e, t, s, a, n) {
1883
+ function Ji(i, e, t, n, a, s) {
1881
1884
  switch (i) {
1882
1885
  case 0:
1883
- Ee(e, t, a);
1886
+ ke(e, t, a);
1884
1887
  break;
1885
1888
  case 1:
1886
- ke(e, t, a, n);
1889
+ Ee(e, t, a, s);
1887
1890
  break;
1888
1891
  case 2:
1889
- Ae(e, t, s, a);
1892
+ Ae(e, t, n, a);
1890
1893
  break;
1891
1894
  case 3:
1892
- Te(e, t, s, a, n);
1895
+ Te(e, t, n, a, s);
1893
1896
  break;
1894
1897
  case 4:
1895
- me(e, t, s, a, n);
1898
+ me(e, t, n, a, s);
1896
1899
  break;
1897
1900
  default:
1898
1901
  throw new Error(`Unsupported filter: ${i}`);
1899
1902
  }
1900
1903
  }
1901
- const Qi = new Uint16Array([255]), ts = new Uint8Array(Qi.buffer), es = ts[0] === 255;
1902
- function is(i) {
1903
- const { data: e, width: t, height: s, channels: a, depth: n } = i, l = [
1904
+ const Qi = new Uint16Array([255]), tn = new Uint8Array(Qi.buffer), en = tn[0] === 255;
1905
+ function nn(i) {
1906
+ const { data: e, width: t, height: n, channels: a, depth: s } = i, l = [
1904
1907
  { x: 0, y: 0, xStep: 8, yStep: 8 },
1905
1908
  // Pass 1
1906
1909
  { x: 4, y: 0, xStep: 8, yStep: 8 },
@@ -1915,10 +1918,10 @@ function is(i) {
1915
1918
  // Pass 6
1916
1919
  { x: 0, y: 1, xStep: 1, yStep: 2 }
1917
1920
  // Pass 7
1918
- ], h = Math.ceil(n / 8) * a, d = new Uint8Array(s * t * h);
1921
+ ], h = Math.ceil(s / 8) * a, d = new Uint8Array(n * t * h);
1919
1922
  let r = 0;
1920
1923
  for (let o = 0; o < 7; o++) {
1921
- const w = l[o], u = Math.ceil((t - w.x) / w.xStep), f = Math.ceil((s - w.y) / w.yStep);
1924
+ const w = l[o], u = Math.ceil((t - w.x) / w.xStep), f = Math.ceil((n - w.y) / w.yStep);
1922
1925
  if (u <= 0 || f <= 0)
1923
1926
  continue;
1924
1927
  const _ = u * h, U = new Uint8Array(_);
@@ -1928,36 +1931,36 @@ function is(i) {
1928
1931
  const y = new Uint8Array(_);
1929
1932
  Ji(g, T, y, U, _, h), U.set(y);
1930
1933
  for (let c = 0; c < u; c++) {
1931
- const k = w.x + c * w.xStep, I = w.y + x * w.yStep;
1932
- if (!(k >= t || I >= s))
1934
+ const E = w.x + c * w.xStep, I = w.y + x * w.yStep;
1935
+ if (!(E >= t || I >= n))
1933
1936
  for (let p = 0; p < h; p++)
1934
- d[(I * t + k) * h + p] = y[c * h + p];
1937
+ d[(I * t + E) * h + p] = y[c * h + p];
1935
1938
  }
1936
1939
  }
1937
1940
  }
1938
- if (n === 16) {
1941
+ if (s === 16) {
1939
1942
  const o = new Uint16Array(d.buffer);
1940
- if (es)
1943
+ if (en)
1941
1944
  for (let w = 0; w < o.length; w++)
1942
- o[w] = ss(o[w]);
1945
+ o[w] = sn(o[w]);
1943
1946
  return o;
1944
1947
  } else
1945
1948
  return d;
1946
1949
  }
1947
- function ss(i) {
1950
+ function sn(i) {
1948
1951
  return (i & 255) << 8 | i >> 8 & 255;
1949
1952
  }
1950
- const ns = new Uint16Array([255]), as = new Uint8Array(ns.buffer), rs = as[0] === 255, os = new Uint8Array(0);
1953
+ const an = new Uint16Array([255]), rn = new Uint8Array(an.buffer), on = rn[0] === 255, hn = new Uint8Array(0);
1951
1954
  function Jt(i) {
1952
- const { data: e, width: t, height: s, channels: a, depth: n } = i, l = Math.ceil(n / 8) * a, h = Math.ceil(n / 8 * a * t), d = new Uint8Array(s * h);
1953
- let r = os, o = 0, w, u;
1954
- for (let f = 0; f < s; f++) {
1955
+ const { data: e, width: t, height: n, channels: a, depth: s } = i, l = Math.ceil(s / 8) * a, h = Math.ceil(s / 8 * a * t), d = new Uint8Array(n * h);
1956
+ let r = hn, o = 0, w, u;
1957
+ for (let f = 0; f < n; f++) {
1955
1958
  switch (w = e.subarray(o + 1, o + 1 + h), u = d.subarray(f * h, (f + 1) * h), e[o]) {
1956
1959
  case 0:
1957
- Ee(w, u, h);
1960
+ ke(w, u, h);
1958
1961
  break;
1959
1962
  case 1:
1960
- ke(w, u, h, l);
1963
+ Ee(w, u, h, l);
1961
1964
  break;
1962
1965
  case 2:
1963
1966
  Ae(w, u, r, h);
@@ -1973,24 +1976,24 @@ function Jt(i) {
1973
1976
  }
1974
1977
  r = u, o += h + 1;
1975
1978
  }
1976
- if (n === 16) {
1979
+ if (s === 16) {
1977
1980
  const f = new Uint16Array(d.buffer);
1978
- if (rs)
1981
+ if (on)
1979
1982
  for (let _ = 0; _ < f.length; _++)
1980
- f[_] = hs(f[_]);
1983
+ f[_] = ln(f[_]);
1981
1984
  return f;
1982
1985
  } else
1983
1986
  return d;
1984
1987
  }
1985
- function hs(i) {
1988
+ function ln(i) {
1986
1989
  return (i & 255) << 8 | i >> 8 & 255;
1987
1990
  }
1988
1991
  const J = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
1989
1992
  function Qt(i) {
1990
- if (!ls(i.readBytes(J.length)))
1993
+ if (!fn(i.readBytes(J.length)))
1991
1994
  throw new Error("wrong PNG signature");
1992
1995
  }
1993
- function ls(i) {
1996
+ function fn(i) {
1994
1997
  if (i.length < J.length)
1995
1998
  return !1;
1996
1999
  for (let e = 0; e < J.length; e++)
@@ -1998,29 +2001,29 @@ function ls(i) {
1998
2001
  return !1;
1999
2002
  return !0;
2000
2003
  }
2001
- const fs = "tEXt", cs = 0, ve = new TextDecoder("latin1");
2002
- function ds(i) {
2003
- if (_s(i), i.length === 0 || i.length > 79)
2004
+ const cn = "tEXt", dn = 0, ve = new TextDecoder("latin1");
2005
+ function un(i) {
2006
+ if (pn(i), i.length === 0 || i.length > 79)
2004
2007
  throw new Error("keyword length must be between 1 and 79");
2005
2008
  }
2006
- const us = /^[\u0000-\u00FF]*$/;
2007
- function _s(i) {
2008
- if (!us.test(i))
2009
+ const _n = /^[\u0000-\u00FF]*$/;
2010
+ function pn(i) {
2011
+ if (!_n.test(i))
2009
2012
  throw new Error("invalid latin1 text");
2010
2013
  }
2011
- function ps(i, e, t) {
2012
- const s = Ue(e);
2013
- i[s] = ws(e, t - s.length - 1);
2014
+ function wn(i, e, t) {
2015
+ const n = Ue(e);
2016
+ i[n] = gn(e, t - n.length - 1);
2014
2017
  }
2015
2018
  function Ue(i) {
2016
- for (i.mark(); i.readByte() !== cs; )
2019
+ for (i.mark(); i.readByte() !== dn; )
2017
2020
  ;
2018
2021
  const e = i.offset;
2019
2022
  i.reset();
2020
2023
  const t = ve.decode(i.readBytes(e - i.offset - 1));
2021
- return i.skip(1), ds(t), t;
2024
+ return i.skip(1), un(t), t;
2022
2025
  }
2023
- function ws(i, e) {
2026
+ function gn(i, e) {
2024
2027
  return ve.decode(i.readBytes(e));
2025
2028
  }
2026
2029
  const O = {
@@ -2048,7 +2051,7 @@ const O = {
2048
2051
  SOURCE: 0,
2049
2052
  OVER: 1
2050
2053
  };
2051
- class gs extends wt {
2054
+ class bn extends wt {
2052
2055
  _checkCrc;
2053
2056
  _inflator;
2054
2057
  _png;
@@ -2069,8 +2072,8 @@ class gs extends wt {
2069
2072
  _writingDataChunks;
2070
2073
  constructor(e, t = {}) {
2071
2074
  super(e);
2072
- const { checkCrc: s = !1 } = t;
2073
- this._checkCrc = s, this._inflator = new Xt(), this._png = {
2075
+ const { checkCrc: n = !1 } = t;
2076
+ this._checkCrc = n, this._inflator = new Xt(), this._png = {
2074
2077
  width: -1,
2075
2078
  height: -1,
2076
2079
  channels: -1,
@@ -2104,7 +2107,7 @@ class gs extends wt {
2104
2107
  }
2105
2108
  // https://www.w3.org/TR/PNG/#5Chunk-layout
2106
2109
  decodeChunk(e, t) {
2107
- const s = this.offset;
2110
+ const n = this.offset;
2108
2111
  switch (t) {
2109
2112
  // 11.2 Critical chunks
2110
2113
  case "IHDR":
@@ -2126,8 +2129,8 @@ class gs extends wt {
2126
2129
  case "iCCP":
2127
2130
  this.decodeiCCP(e);
2128
2131
  break;
2129
- case fs:
2130
- ps(this._png.text, this, e);
2132
+ case cn:
2133
+ wn(this._png.text, this, e);
2131
2134
  break;
2132
2135
  case "pHYs":
2133
2136
  this.decodepHYs();
@@ -2136,12 +2139,12 @@ class gs extends wt {
2136
2139
  this.skip(e);
2137
2140
  break;
2138
2141
  }
2139
- if (this.offset - s !== e)
2142
+ if (this.offset - n !== e)
2140
2143
  throw new Error(`Length mismatch while decoding chunk ${t}`);
2141
2144
  this._checkCrc ? qt(this, e + 4, t) : this.skip(4);
2142
2145
  }
2143
2146
  decodeApngChunk(e, t) {
2144
- const s = this.offset;
2147
+ const n = this.offset;
2145
2148
  switch (t !== "fdAT" && t !== "IDAT" && this._writingDataChunks && this.pushDataToFrame(), t) {
2146
2149
  case "acTL":
2147
2150
  this.decodeACTL();
@@ -2153,35 +2156,35 @@ class gs extends wt {
2153
2156
  this.decodeFDAT(e);
2154
2157
  break;
2155
2158
  default:
2156
- this.decodeChunk(e, t), this.offset = s + e;
2159
+ this.decodeChunk(e, t), this.offset = n + e;
2157
2160
  break;
2158
2161
  }
2159
- if (this.offset - s !== e)
2162
+ if (this.offset - n !== e)
2160
2163
  throw new Error(`Length mismatch while decoding chunk ${t}`);
2161
2164
  this._checkCrc ? qt(this, e + 4, t) : this.skip(4);
2162
2165
  }
2163
2166
  // https://www.w3.org/TR/PNG/#11IHDR
2164
2167
  decodeIHDR() {
2165
2168
  const e = this._png;
2166
- e.width = this.readUint32(), e.height = this.readUint32(), e.depth = bs(this.readUint8());
2169
+ e.width = this.readUint32(), e.height = this.readUint32(), e.depth = xn(this.readUint8());
2167
2170
  const t = this.readUint8();
2168
2171
  this._colorType = t;
2169
- let s;
2172
+ let n;
2170
2173
  switch (t) {
2171
2174
  case O.GREYSCALE:
2172
- s = 1;
2175
+ n = 1;
2173
2176
  break;
2174
2177
  case O.TRUECOLOUR:
2175
- s = 3;
2178
+ n = 3;
2176
2179
  break;
2177
2180
  case O.INDEXED_COLOUR:
2178
- s = 1;
2181
+ n = 1;
2179
2182
  break;
2180
2183
  case O.GREYSCALE_ALPHA:
2181
- s = 2;
2184
+ n = 2;
2182
2185
  break;
2183
2186
  case O.TRUECOLOUR_ALPHA:
2184
- s = 4;
2187
+ n = 4;
2185
2188
  break;
2186
2189
  // Kept for exhaustiveness.
2187
2190
  // eslint-disable-next-line unicorn/no-useless-switch-case
@@ -2189,7 +2192,7 @@ class gs extends wt {
2189
2192
  default:
2190
2193
  throw new Error(`Unknown color type: ${t}`);
2191
2194
  }
2192
- if (this._png.channels = s, this._compressionMethod = this.readUint8(), this._compressionMethod !== ft.DEFLATE)
2195
+ if (this._png.channels = n, this._compressionMethod = this.readUint8(), this._compressionMethod !== ft.DEFLATE)
2193
2196
  throw new Error(`Unsupported compression method: ${this._compressionMethod}`);
2194
2197
  this._filterMethod = this.readUint8(), this._interlaceMethod = this.readUint8();
2195
2198
  }
@@ -2217,23 +2220,23 @@ class gs extends wt {
2217
2220
  throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);
2218
2221
  const t = e / 3;
2219
2222
  this._hasPalette = !0;
2220
- const s = [];
2221
- this._palette = s;
2223
+ const n = [];
2224
+ this._palette = n;
2222
2225
  for (let a = 0; a < t; a++)
2223
- s.push([this.readUint8(), this.readUint8(), this.readUint8()]);
2226
+ n.push([this.readUint8(), this.readUint8(), this.readUint8()]);
2224
2227
  }
2225
2228
  // https://www.w3.org/TR/PNG/#11IDAT
2226
2229
  decodeIDAT(e) {
2227
2230
  this._writingDataChunks = !0;
2228
- const t = e, s = this.offset + this.byteOffset;
2229
- if (this._inflator.push(new Uint8Array(this.buffer, s, t)), this._inflator.err)
2231
+ const t = e, n = this.offset + this.byteOffset;
2232
+ if (this._inflator.push(new Uint8Array(this.buffer, n, t)), this._inflator.err)
2230
2233
  throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
2231
2234
  this.skip(e);
2232
2235
  }
2233
2236
  decodeFDAT(e) {
2234
2237
  this._writingDataChunks = !0;
2235
- let t = e, s = this.offset + this.byteOffset;
2236
- if (s += 4, t -= 4, this._inflator.push(new Uint8Array(this.buffer, s, t)), this._inflator.err)
2238
+ let t = e, n = this.offset + this.byteOffset;
2239
+ if (n += 4, t -= 4, this._inflator.push(new Uint8Array(this.buffer, n, t)), this._inflator.err)
2237
2240
  throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
2238
2241
  this.skip(e);
2239
2242
  }
@@ -2256,8 +2259,8 @@ class gs extends wt {
2256
2259
  throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);
2257
2260
  let t = 0;
2258
2261
  for (; t < e; t++) {
2259
- const s = this.readByte();
2260
- this._palette[t].push(s);
2262
+ const n = this.readByte();
2263
+ this._palette[t].push(n);
2261
2264
  }
2262
2265
  for (; t < this._palette.length; t++)
2263
2266
  this._palette[t].push(255);
@@ -2274,9 +2277,9 @@ class gs extends wt {
2274
2277
  }
2275
2278
  // https://www.w3.org/TR/PNG/#11iCCP
2276
2279
  decodeiCCP(e) {
2277
- const t = Ue(this), s = this.readUint8();
2278
- if (s !== ft.DEFLATE)
2279
- throw new Error(`Unsupported iCCP compression method: ${s}`);
2280
+ const t = Ue(this), n = this.readUint8();
2281
+ if (n !== ft.DEFLATE)
2282
+ throw new Error(`Unsupported iCCP compression method: ${n}`);
2280
2283
  const a = this.readBytes(e - t.length - 2);
2281
2284
  this._png.iccEmbeddedProfile = {
2282
2285
  name: t,
@@ -2285,11 +2288,11 @@ class gs extends wt {
2285
2288
  }
2286
2289
  // https://www.w3.org/TR/PNG/#11pHYs
2287
2290
  decodepHYs() {
2288
- const e = this.readUint32(), t = this.readUint32(), s = this.readByte();
2291
+ const e = this.readUint32(), t = this.readUint32(), n = this.readByte();
2289
2292
  this._png.resolution = {
2290
2293
  x: e,
2291
2294
  y: t,
2292
- unit: s
2295
+ unit: n
2293
2296
  };
2294
2297
  }
2295
2298
  decodeApngImage() {
@@ -2300,65 +2303,65 @@ class gs extends wt {
2300
2303
  delayNumber: this._frames[e].delayNumber,
2301
2304
  delayDenominator: this._frames[e].delayDenominator,
2302
2305
  data: this._apng.depth === 8 ? new Uint8Array(this._apng.width * this._apng.height * this._apng.channels) : new Uint16Array(this._apng.width * this._apng.height * this._apng.channels)
2303
- }, s = this._frames.at(e);
2304
- if (s) {
2305
- if (s.data = Jt({
2306
- data: s.data,
2307
- width: s.width,
2308
- height: s.height,
2306
+ }, n = this._frames.at(e);
2307
+ if (n) {
2308
+ if (n.data = Jt({
2309
+ data: n.data,
2310
+ width: n.width,
2311
+ height: n.height,
2309
2312
  channels: this._apng.channels,
2310
2313
  depth: this._apng.depth
2311
- }), this._hasPalette && (this._apng.palette = this._palette), this._hasTransparency && (this._apng.transparency = this._transparency), e === 0 || s.xOffset === 0 && s.yOffset === 0 && s.width === this._png.width && s.height === this._png.height)
2312
- t.data = s.data;
2314
+ }), this._hasPalette && (this._apng.palette = this._palette), this._hasTransparency && (this._apng.transparency = this._transparency), e === 0 || n.xOffset === 0 && n.yOffset === 0 && n.width === this._png.width && n.height === this._png.height)
2315
+ t.data = n.data;
2313
2316
  else {
2314
2317
  const a = this._apng.frames.at(e - 1);
2315
- this.disposeFrame(s, a, t), this.addFrameDataToCanvas(t, s);
2318
+ this.disposeFrame(n, a, t), this.addFrameDataToCanvas(t, n);
2316
2319
  }
2317
2320
  this._apng.frames.push(t);
2318
2321
  }
2319
2322
  }
2320
2323
  return this._apng;
2321
2324
  }
2322
- disposeFrame(e, t, s) {
2325
+ disposeFrame(e, t, n) {
2323
2326
  switch (e.disposeOp) {
2324
2327
  case V.NONE:
2325
2328
  break;
2326
2329
  case V.BACKGROUND:
2327
2330
  for (let a = 0; a < this._png.height; a++)
2328
- for (let n = 0; n < this._png.width; n++) {
2329
- const l = (a * e.width + n) * this._png.channels;
2331
+ for (let s = 0; s < this._png.width; s++) {
2332
+ const l = (a * e.width + s) * this._png.channels;
2330
2333
  for (let h = 0; h < this._png.channels; h++)
2331
- s.data[l + h] = 0;
2334
+ n.data[l + h] = 0;
2332
2335
  }
2333
2336
  break;
2334
2337
  case V.PREVIOUS:
2335
- s.data.set(t.data);
2338
+ n.data.set(t.data);
2336
2339
  break;
2337
2340
  default:
2338
2341
  throw new Error("Unknown disposeOp");
2339
2342
  }
2340
2343
  }
2341
2344
  addFrameDataToCanvas(e, t) {
2342
- const s = 1 << this._png.depth, a = (n, l) => {
2343
- const h = ((n + t.yOffset) * this._png.width + t.xOffset + l) * this._png.channels, d = (n * t.width + l) * this._png.channels;
2345
+ const n = 1 << this._png.depth, a = (s, l) => {
2346
+ const h = ((s + t.yOffset) * this._png.width + t.xOffset + l) * this._png.channels, d = (s * t.width + l) * this._png.channels;
2344
2347
  return { index: h, frameIndex: d };
2345
2348
  };
2346
2349
  switch (t.blendOp) {
2347
2350
  case dt.SOURCE:
2348
- for (let n = 0; n < t.height; n++)
2351
+ for (let s = 0; s < t.height; s++)
2349
2352
  for (let l = 0; l < t.width; l++) {
2350
- const { index: h, frameIndex: d } = a(n, l);
2353
+ const { index: h, frameIndex: d } = a(s, l);
2351
2354
  for (let r = 0; r < this._png.channels; r++)
2352
2355
  e.data[h + r] = t.data[d + r];
2353
2356
  }
2354
2357
  break;
2355
2358
  // https://www.w3.org/TR/png-3/#13Alpha-channel-processing
2356
2359
  case dt.OVER:
2357
- for (let n = 0; n < t.height; n++)
2360
+ for (let s = 0; s < t.height; s++)
2358
2361
  for (let l = 0; l < t.width; l++) {
2359
- const { index: h, frameIndex: d } = a(n, l);
2362
+ const { index: h, frameIndex: d } = a(s, l);
2360
2363
  for (let r = 0; r < this._png.channels; r++) {
2361
- const o = t.data[d + this._png.channels - 1] / s, w = r % (this._png.channels - 1) === 0 ? 1 : t.data[d + r], u = Math.floor(o * w + (1 - o) * e.data[h + r]);
2364
+ const o = t.data[d + this._png.channels - 1] / n, w = r % (this._png.channels - 1) === 0 ? 1 : t.data[d + r], u = Math.floor(o * w + (1 - o) * e.data[h + r]);
2362
2365
  e.data[h + r] += u;
2363
2366
  }
2364
2367
  }
@@ -2382,7 +2385,7 @@ class gs extends wt {
2382
2385
  depth: this._png.depth
2383
2386
  });
2384
2387
  else if (this._interlaceMethod === ct.ADAM7)
2385
- this._png.data = is({
2388
+ this._png.data = nn({
2386
2389
  data: e,
2387
2390
  width: this._png.width,
2388
2391
  height: this._png.height,
@@ -2409,20 +2412,20 @@ class gs extends wt {
2409
2412
  }), this._inflator = new Xt(), this._writingDataChunks = !1;
2410
2413
  }
2411
2414
  }
2412
- function bs(i) {
2415
+ function xn(i) {
2413
2416
  if (i !== 1 && i !== 2 && i !== 4 && i !== 8 && i !== 16)
2414
2417
  throw new Error(`invalid bit depth: ${i}`);
2415
2418
  return i;
2416
2419
  }
2417
- function xs(i, e) {
2418
- return new gs(i, e).decode();
2420
+ function yn(i, e) {
2421
+ return new bn(i, e).decode();
2419
2422
  }
2420
- class ys {
2423
+ class kn {
2421
2424
  #e;
2422
2425
  #t;
2423
- #s;
2424
- #i;
2425
2426
  #n;
2427
+ #i;
2428
+ #s;
2426
2429
  elevs;
2427
2430
  /**
2428
2431
  * Create a new DEM.
@@ -2434,8 +2437,8 @@ class ys {
2434
2437
  * @param {number} xSpacing - spacing in Spherical Mercator units in the horizontal direction.
2435
2438
  * @param {number} ySpacing - spacing in Spherical Mercator units in the vertical direction.
2436
2439
  */
2437
- constructor(e, t, s, a, n, l) {
2438
- this.#e = t, this.#t = s, this.#s = a, this.elevs = e, this.#i = n, this.#n = l;
2440
+ constructor(e, t, n, a, s, l) {
2441
+ this.#e = t, this.#t = n, this.#n = a, this.elevs = e, this.#i = s, this.#s = l;
2439
2442
  }
2440
2443
  /** Obtains the elevation in metres at a given x and y Spherical Mercator coordinate using bilinear interpolation.
2441
2444
  * @param {number} x - the Spherical Mercator x coordinate.
@@ -2443,16 +2446,16 @@ class ys {
2443
2446
  * @return {number} the elevation in metres
2444
2447
  */
2445
2448
  getElevation(e, t) {
2446
- let s = [e, t], a = Math.floor((s[0] - this.#e.e) / this.#i), n = this.#s - Math.ceil((s[1] - this.#e.n) / this.#n), l, h, d, r, o, w, u, f = Number.NEGATIVE_INFINITY;
2447
- if (a >= 0 && n >= 0 && a < this.#t - 1 && n < this.#s - 1) {
2448
- r = this.elevs[n * this.#t + a], o = this.elevs[n * this.#t + a + 1], w = this.elevs[n * this.#t + a + this.#t], u = this.elevs[n * this.#t + a + this.#t + 1], l = this.#e.e + a * this.#i, l + this.#i, h = this.#e.n + (this.#s - 1 - n) * this.#n, d = h - this.#n;
2449
- let _ = (s[0] - l) / this.#i, U = r * (1 - _) + o * _, x = w * (1 - _) + u * _, g = (s[1] - d) / this.#n;
2449
+ let n = [e, t], a = Math.floor((n[0] - this.#e.e) / this.#i), s = this.#n - Math.ceil((n[1] - this.#e.n) / this.#s), l, h, d, r, o, w, u, f = null;
2450
+ if (a >= 0 && s >= 0 && a < this.#t - 1 && s < this.#n - 1) {
2451
+ r = this.elevs[s * this.#t + a], o = this.elevs[s * this.#t + a + 1], w = this.elevs[s * this.#t + a + this.#t], u = this.elevs[s * this.#t + a + this.#t + 1], l = this.#e.e + a * this.#i, l + this.#i, h = this.#e.n + (this.#n - 1 - s) * this.#s, d = h - this.#s;
2452
+ let _ = (n[0] - l) / this.#i, U = r * (1 - _) + o * _, x = w * (1 - _) + u * _, g = (n[1] - d) / this.#s;
2450
2453
  f = x * (1 - g) + U * g;
2451
2454
  }
2452
2455
  return f;
2453
2456
  }
2454
2457
  }
2455
- class Es extends ie {
2458
+ class En extends ie {
2456
2459
  /**
2457
2460
  * Create a DemTiler.
2458
2461
  * @class
@@ -2467,14 +2470,14 @@ class Es extends ie {
2467
2470
  * @return {Promise<any>} a Promise resolving with raw DEM data.
2468
2471
  */
2469
2472
  async readTile(e) {
2470
- const s = await (await fetch(e, {
2473
+ const n = await (await fetch(e, {
2471
2474
  signal: AbortSignal.timeout(3e4)
2472
- })).arrayBuffer(), a = xs(s);
2473
- let n, l = 0;
2475
+ })).arrayBuffer(), a = yn(n);
2476
+ let s, l = 0;
2474
2477
  const h = new Array(a.width * a.height);
2475
2478
  for (let d = 0; d < a.height; d++)
2476
2479
  for (let r = 0; r < a.width; r++)
2477
- n = (d * a.width + r) * a.channels, h[l++] = Math.round(a.data[n] * 256 + a.data[n + 1] + a.data[n + 2] / 256 - 32768);
2480
+ s = (d * a.width + r) * a.channels, h[l++] = Math.round(a.data[s] * 256 + a.data[s + 1] + a.data[s + 2] / 256 - 32768);
2478
2481
  return { w: a.width, h: a.height, elevs: h };
2479
2482
  }
2480
2483
  /**
@@ -2483,8 +2486,8 @@ class Es extends ie {
2483
2486
  * @return {number} the elevation in metres, or Number.NEGATIVE_INFINITY if this position is outside the extent of the DEM.
2484
2487
  */
2485
2488
  getElevation(e) {
2486
- const t = this.getTile(e, this.tile.z), s = this.dataTiles[`${t.z}/${t.x}/${t.y}`];
2487
- return s ? s.getElevation(e[0], e[1]) : Number.NEGATIVE_INFINITY;
2489
+ const t = this.getTile(e, this.tile.z), n = this.dataTiles.get(`${t.z}/${t.x}/${t.y}`);
2490
+ return n ? n.data.getElevation(e.e, e.n) : null;
2488
2491
  }
2489
2492
  /**
2490
2493
  * Obtain the elevation in metres for a given longitude/latitude.
@@ -2501,18 +2504,18 @@ class Es extends ie {
2501
2504
  * @return {DataTile} the DataTile pairing the Tile and the DEM data as a DEM object.
2502
2505
  */
2503
2506
  rawTileToStoredTile(e, t) {
2504
- const s = e.getTopRight(), a = e.getBottomLeft(), n = (s.e - a.e) / (t.w - 1), l = (s.n - a.n) / (t.h - 1), h = new ys(
2507
+ const n = e.getTopRight(), a = e.getBottomLeft(), s = (n.e - a.e) / (t.w - 1), l = (n.n - a.n) / (t.h - 1), h = new kn(
2505
2508
  t.elevs,
2506
2509
  a,
2507
2510
  t.w,
2508
2511
  t.h,
2509
- n,
2512
+ s,
2510
2513
  l
2511
2514
  );
2512
2515
  return { tile: e, data: h };
2513
2516
  }
2514
2517
  }
2515
- class ks extends ie {
2518
+ class An extends ie {
2516
2519
  /**
2517
2520
  * Create a JsonTiler.
2518
2521
  * @class
@@ -2532,7 +2535,7 @@ class ks extends ie {
2532
2535
  })).json();
2533
2536
  }
2534
2537
  }
2535
- class As {
2538
+ class Tn {
2536
2539
  e;
2537
2540
  n;
2538
2541
  /**
@@ -2544,12 +2547,19 @@ class As {
2544
2547
  constructor(e, t) {
2545
2548
  this.e = e, this.n = t;
2546
2549
  }
2550
+ /**
2551
+ * Returns a string representation of the EastNorth.
2552
+ * @return {string} the string representation.
2553
+ */
2554
+ toString() {
2555
+ return `e: ${this.e}, n: ${this.n}`;
2556
+ }
2547
2557
  }
2548
2558
  class ee {
2549
2559
  lon;
2550
2560
  lat;
2551
2561
  /**
2552
- * Creates an LonLat.
2562
+ * Creates a LonLat.
2553
2563
  * @class
2554
2564
  * @param {number} lon - the longitude.
2555
2565
  * @param {number} lat - the latitude.
@@ -2557,8 +2567,15 @@ class ee {
2557
2567
  constructor(e, t) {
2558
2568
  this.lon = e, this.lat = t;
2559
2569
  }
2570
+ /**
2571
+ * Returns a string representation of the LonLat.
2572
+ * @return {string} the string representation.
2573
+ */
2574
+ toString() {
2575
+ return `lon: ${this.lon}, lat: ${this.lat}`;
2576
+ }
2560
2577
  }
2561
- class Ts {
2578
+ class mn {
2562
2579
  demTiler;
2563
2580
  jsonTiler;
2564
2581
  /**
@@ -2580,13 +2597,13 @@ class Ts {
2580
2597
  * @return {Promise<DataTile[]>} promise resolving with an array of updated JSON tiles with elevation added as a third member of the coordinates of each point. As for Tiler, only the newly-downloaded tiles are returned.
2581
2598
  */
2582
2599
  async updateByLonLat(e) {
2583
- const t = this.demTiler.sphMerc.project(e), s = await this.demTiler.update(t), a = await this.jsonTiler.update(t);
2584
- return s.forEach((n, l) => {
2585
- this.#e(n, a[l]);
2600
+ const t = this.demTiler.sphMerc.project(e), n = await this.demTiler.update(t), a = await this.jsonTiler.update(t);
2601
+ return n.forEach((s, l) => {
2602
+ this.#e(s, a[l]);
2586
2603
  }), a;
2587
2604
  }
2588
2605
  async #e(e, t) {
2589
- t.data.features.forEach((a, n) => {
2606
+ t.data.features.forEach((a, s) => {
2590
2607
  if (a.geometry.type == "LineString" && a.geometry.coordinates.length >= 2)
2591
2608
  a.geometry.coordinates.forEach((l) => {
2592
2609
  const h = this.demTiler.sphMerc.project(new ee(l[0], l[1])), d = e.data?.getElevation(h.e, h.n) ?? 0;
@@ -2601,12 +2618,12 @@ class Ts {
2601
2618
  }
2602
2619
  }
2603
2620
  export {
2604
- C as Constants,
2605
- ys as DEM,
2606
- Ts as DemApplier,
2607
- Es as DemTiler,
2608
- As as EastNorth,
2609
- ks as JsonTiler,
2621
+ N as Constants,
2622
+ kn as DEM,
2623
+ mn as DemApplier,
2624
+ En as DemTiler,
2625
+ Tn as EastNorth,
2626
+ An as JsonTiler,
2610
2627
  ee as LonLat,
2611
2628
  Ie as SphMercProjection,
2612
2629
  q as Tile,